I have a storyline project consisting of one main menu and 2 sub menus. The first sub menu uses javascript to generate random numbers from 0 to 19. This works perfectly well. However in the second sub menu i want the random numbers to start from 20 and finish at 40. i don't know how to do this. Please can only one provide the appropriate javascript for me to copy and paste this into storyline 2.
I'm not equipped to assist with Javascript as it's not something we can offer support for. You may want to share more information about the code you've set up and how it is working in the one scenario so that folks could offer advice based on your specific code.
6 Replies
Hi Chris,
I'm not equipped to assist with Javascript as it's not something we can offer support for. You may want to share more information about the code you've set up and how it is working in the one scenario so that folks could offer advice based on your specific code.
Best of luck with the project!
Try this and make sure that you have Storyline variable (in this example randnum):
var randomnumber = Math.floor(Math.random() * (40 - 20 +1)) + 20;
var player = GetPlayer();
player.SetVar("randnum",randomnumber);
Thanks will give it ago
Chris
Sent from Samsung Mobile on O2
Hi Michael
It works a treat
Chris
Glad that Michael was able to assist you here Chris :) Thanks for popping in with an update.
Your welcome
Sent from Samsung Mobile on O2
This discussion is closed. You can start a new discussion or contact Articulate Support.