Forum Discussion
MathNotermans-9
4 years agoCommunity Member
Global scope for Javascript variables in Storyline
As Storyline publishes all code and variables to separate functions in the user.js file the scope for individual variables is local. The solution i show here creates a global scope for functions and...
EmmanuelNdlec
8 months agoCommunity Member
Ok, I finally found my error : the "getGlobalValue" function shouldn't return
return obj2Use[_prop].value;
but
return obj2Use[_prop];
and for the record, I think Math wrote it, but I initially didn't find it in a old version of globaScript.js so that's why I re-wrote it.
I must have messed it long ago.
Lesson learned : backup and name your files / folders properly, don't rely on your memory 😆
Related Content
- 10 months ago