Forum Discussion
ChrisAmmon
12 years agoCommunity Member
Reset multiple variables to default values
Is there any shortcut for reseting many variable to their default values? I'm creating a scenario based training in which I have about 20 variables tracking user progress. If they choose to restart ...
SteveGannon
12 years agoCommunity Member
Thanks for the clarification, Chris. In that case, you could execute some JavaScript via the Execute JavaScript trigger to reset the variables, such as in the code between the dashed lines below:
---------
var player = GetPlayer();
player.SetVar("variable1", "John");
player.SetVar("variable2", "Doe");
----------
You would replace "variable1" and "variable2" with the variable names just as they're spelled in your Storyline file. The text in quotes after the variable names represent the values you want to reset the variables to. Remember you'll need to publish your file before you can test the JavaScript. And remember it won't work in the AMP app on the iPad.
Related Content
- 12 months ago
- 12 months ago
- 12 months ago
- 12 months ago