Arrays and variables through JS in storyline

Aug 12, 2014

Trying to have one a a set of Numbers to display on the last slide using a token from the variable and setting the variable with JS. Here is JS

var codeArray=[62312,12636,54623,74624,12537,73754,46577,42467,13945,89562];

completionCode=codeArray[Math.round(Math.random()*(codeArray.length-1))];

I declare the variable completionCode in the variable screens as 0 and it displays as 0. Cant get the JS to update the variable to use one of the indexs in codearray. .

4 Replies

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