Forum Discussion
SergeyAvseenko
9 months agoCommunity Member
Change the status of the CheckBox on restart based on LocalStorage
Hello!
There is a task to make sure that the progress between sessions is saved in localStorage. Specifically, the CheckBox states (Normal/Selected).
1. Using JavaScript, I made it so that when ...
Jürgen_Schoene_
9 months agoCommunity Member
your main problem
- you need GetPlayer.SetVar() to access from javascript to the storyline variables
here is the fixed script for the start of the slide
var red = localStorage.getItem("Red");
var green = localStorage.getItem("Green");
var blue = localStorage.getItem("Blue");
var player = GetPlayer();
player.SetVar( "globalRed", Boolean(red) );
player.SetVar( "globalGreen", Boolean(green) );
player.SetVar( "globalBlue", Boolean(blue) );
https://360.articulate.com/review/content/f47b115f-340e-4ab9-b7dc-00074ebd62b7/review
update: setVar -> SetVar