Apparent problem with javascript and variables
Jun 06, 2015
Hello everyone,
I recently upgraded to SL2, and I'm currently working on a project where I need to pass values to SL. To do that I'm using the URL and the code that's been posted on this forum to extract values. It works like a charm, and I can load said values into SL2 variables using player.SetVar().
For this I use a single trigger on the first slide. The problem starts when I added a trigger on a second slide and I try using the player object. The variables are no longer being set properly, as a matter of fact, nothing is read into the variables.
Has anyone run into a similar problem, and is there any fix or workaround for it?
Thanks
2 Replies
Hi, Carlos - Although we don't provide support for JavaScript coding, it may be helpful to take a look at this document on JavaScript Best Practices. Hopefully, some of our JS experts in the community can chime in with suggestions!
I would double check the code to make sure everything is correct. A single missing bracket or improper syntax will cause all of your functions to not work. This is because SL seems to execute all the different scripts as a single function.
This discussion is closed. You can start a new discussion or contact Articulate Support.