Are you testing locally (on your harddrive)? In that case, the script is likely blocked by your browser's security settings. Upload to some server and try again. Here I your script running off my server: http://dev.keypointlearn.com/xcl73_SL2/JSRandNum/V1/story.html
Strange that worked for me too! I think it might be because I am publishing to my hard drive.
Yes, that is often the issue. You can fiddle with your Flash player's security settings, and add a folder on your local harddrive as a Trusted Location. Then you can also test locally.
8 Replies
So just making sure, but your publishing before trying to run it right?
What code are you using? Does it use any jQuery?
Yes I am publishing. This is the code that I am using which I know works as it works through the HTML5.story file but not the story.html file.
var randomnumber = Math.floor((Math.random()*10)+1);
var player = GetPlayer();
player.SetVar("randnum",randomnumber);
Thanks
Are you testing locally (on your harddrive)? In that case, the script is likely blocked by your browser's security settings. Upload to some server and try again. Here I your script running off my server: http://dev.keypointlearn.com/xcl73_SL2/JSRandNum/V1/story.html
I'm sorry, I tried posting your code into a new project and its working fine for me from the story.html file.
Is there any other javascript running that is potentially getting in the way of these lines of code?
@Michael Hinze
Strange that worked for me too! I think it might be because I am publishing to my hard drive.
Yes, that is often the issue. You can fiddle with your Flash player's security settings, and add a folder on your local harddrive as a Trusted Location. Then you can also test locally.
Do you know how to do that? As in add a trusted location?
See here: http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html
This discussion is closed. You can start a new discussion or contact Articulate Support.