Executing Javascript with Adjust variable listeners
Jun 11, 2014
I have some slide-level navigation graphics on a series of slides and they listen for "adjust variable" (each graphic listens for a separate variable). I use "Execute JavaScript" when timeline starts on each slide that programmatically adjusts those variables. It works PERFECTLY in HTML5 output but not in Flash. Is there any insight that either you or anyone else can provide on why this is happening? I'm not using the Master Slide for any of this. Also, I've tried executing the Javascript a split second into the timeline using a different shape/object as the trigger BUT it fails just the same. Please advise and thanks in advance!
14 Replies
Hi Jason,
Are you previewing locally or online?
I'm previewing locally BUT it works perfectly in HTML5 and the graphics do change state in the Flash version, just not the appropriate states. Also, it seems to work on the first slide in the set in Flash but not on subsequent slides (the triggers & JS are identical on each slide). It just seems like the graphics are not listening for the "adjust variable" trigger consistently.
Usually with JS previewing locally it's an all-or-none scenario. The JS is functioning correctly but Flash isn't firing/listening for the events consistently it seems.
Hmm... I had posted a long piece that's not showing up. Basically a long way of asking Alex's question with a few recommendations.
The Flash player is sandboxed when playing locally unless you add it to the whitelist. Flash can't interact with JavaScript locally. It's a security thing. Publishing to CD defeats this restriction. It's still playing within a browser.
The security settings manager page is all jacked up...
https://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager03.html
Try this link:
http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html
So, in short, you think publishing to either a CD and testing locally OR publishing to a server could alleviate my issues (considering it's working well in HTML5)?
Yes, definitely. Since it works publishing to CD, the Flash player security block is most likely the problem. Publishing to CD is still employing the HTML / Flash publish. The CD runtime wrapper runs the HTML in a browser instance within a security safe space. This makes the browser run without security chained encumbrances. You could actually upload the CD publish to a Web server and point to the story.html file and it would run in a browser.
It didn't seem to work in the CD published version either--exact same issues. I'm going to try uploading to server.
Can you post an example of the thing that's not working for you?
Steve
Server didn't seem to fix it either. I'm thinking it's a difference in the way events are fired and listened for in different outputs. Thoughts?
This has always worked for me, if I'm interpreting your order of operations correctly. Mind posting a slide that isn't working?
Sure. Here's the source and a published package (Flash & HTML5). I can't figure this out but maybe it's something easy I'm glossing over.
source
Anyone get a chance to check it out? Thx in advance! =)
This discussion is closed. You can start a new discussion or contact Articulate Support.