Cant execute JavaScripts

Nov 13, 2014

I'm doing a game and trying to add a dice whit JavaScript, all works fine but the JavaScript command dont executes when the dice is clicked.

I downloaded a project of the comunity forum where it have a dice and its suposed to work reading the coments but when i publish that project it dont executes the comands too. So, i dont know if im skiping something when publishing the project or something.

This is the code that im using:

var number = Math.floor(Math.random()*6);
GetPlayer.SetVar("dado",number);

Here is the file of my project.

19 Replies
jorge calderon

I tried uploading the game to dropbox and testing it on Chrome, mozilla and Explorer 11. And the game launches fine but the "execute Javascript" trigger dont works, the command dont executes. I leave here the project and this is the published one

https://dl.dropboxusercontent.com/u/40237436/storyline/dragones%20y%20escaleras%20-%20Storyline%20output/story.html

Russell Still

The console complained of a syntax error, in particular, a colon instead of a semicolon on one of lines. I have the JS on every slide so I went through and sure enough, one had a colon. I corrected that, and retested. The same problem and now it says I still have one more. I'm looking for it now. It is odd (or is it?) that one syntax error would make all the JS in the project inoperable. I suppose if it does the equivalent of a compile it might act that way. Anyway, I'll report back shortly.

 

This discussion is closed. You can start a new discussion or contact Articulate Support.