Dice amd javascript

I hope that someone in this community can explain why my JavaScript aint working. 

I got the following script.

var dice = Math.floor(Math.random()*6+1);

var player = GetPlayer();

player.SetVar ("monkey",dice);

Its executed on timeline start.
On the slide i got a textbox where i request "monkey" via %monkey%

But it does not work. The only thing i get is %monkey" writen on my slide.
What am i doing wrong?

6 Replies
Steve Gannon


To add to what Phil said, be sure of the following:

1. You have created a variable called monkey using Storyline's "Create a New Variable" feature.

2. Be sure the monkey variable is numeric and not a text variable.

3. Be sure there is no space between the percent signs and the variable name when typed on the slide:  %monkey%

Hope that helps...