Javascript trigger working in HTML5 but not in Flash

I am using the following Javascript to delay the showing of an button.

setTimeout(function (){ GetPlayer().SetVar("ShowEmailBtn",true)}, 2000);

When I publish and view the output locally, it is working in HTML5 (but there are other issues), and not working in Flash.

Is this a known issue or a bug?

3 Replies
Steve Flowers

Hi Erin - 

Adobe's Flash Player has a security feature that prevents communication with the browser when running locally. To fix this, do one of the following:

  • Publish to CD and run the EXE when running locally
  • Publish to a Web Server to test
  • Add your publish location to the Flash Player Security Settings Manager whitelist. This can be tricky depending on what browser you use.
Steve Flowers

What kind of issues are you seeing in HTML5? One of the things I tend to do is stay away from boolean variables. For triggers from Javascript, I have better luck with number vars. 

setTimeout(function (){ GetPlayer().SetVar("ShowEmailBtn",1)}, 2000);

-or-

var showBtn=GetPlayer().GetVar("ShowEmailBtn");
showBtn++;
setTimeout(function (){ GetPlayer().SetVar("ShowEmailBtn",showBtn)}, 2000);
Erin Flage

Steve,  Thank you so much.  I completely forgot about the security issues of running locally.

The issues I'm seeing in HTML5 are more with the content rather than the javascript.  I have a bulleted list on a layer and in HTML5 the content is being pushed below my shape. 

I've attached a screenshot of what it looks like as authored in Storyline, and what the HTML5 output looks like.