Forum Discussion
Trigger to Initialise/Reset ALL Variables in Storyline 360
i use 2 solutions to tackle this.
1) when setting a variable, also add it to an array. So when resetting i loop the array an set all to false, null, blank or 0.
2) name all variables as v_str_somename , v_num_ or v_bool_.. now you can loop all vars and reset them depending on string, number or boolean.
- GlendaDeHoff-0c5 years agoCommunity Member
I am looking for a solution to reset all of my variables as well. I read on another thread that due to the differences in how Storyline and JavaScript deal with Boolean variables ( JS returns a string), a Javascript solution would not work to reset these variables. Did I misread the other thread?
- PhilMayor5 years agoSuper Hero
You should be able to set a Boolean value in JS just be aware they are case sensitive
Sent from my iPhone
- MathNotermans-94 years agoCommunity Member
Although there indeed is a difference in Booleans between Storyline and Javascript. SL writes and reads them as False, whereas in JS you write/read them as false. This is no problem however when writing a Boolean variable.
This is a line of code i have in most of my Storylines.player.SetVar("javascriptsLoaded", true);
When my external JS libraries are loaded ( jQuery eg. ) it sets the Boolean variable javascriptLoaded to true ( In Storyline its shown as True ). This works perfectly.
Related Content
- 12 months ago
- 12 months ago
- 12 months ago
- 12 months ago
- 12 months ago