Forum Discussion
Stop / reset JavaScript in a storyline
Basically it is scope that makes most timers used onhere ( the one from Toni too ) tough to stop/pause and/or resume.
Scope means that if you define some javascript variable on some spot, it will not automatically be available in another spot. Eg. if you create a trigger on a slide with a function in it.... that function won't be available in any other slide. In fact it wont even be available in another trigger on that slide. It only is available in that particular trigger.
To overcome that you have 2 possibilities.
- Use Storyline variables to save and pass Javascript vars. SL vars are in a global scope.
- Add your Javascript functions and code to the HTML. By using external JS files like my generic_functions setup you can create global JS code that can be used at any time any where.
( https://community.articulate.com/discussions/articulate-storyline/including-javascript-for-repeating-functionality )