Controlling navigation from JavaScript
Nov 15, 2013
Hi everyone,
I am trying to build a simulation where an external JS function determines the next slide that should be visited.
In lack of a better option, I did this:
To the button that controls navigation in each slide, I added the JS code:
var player=GetPlayer();
var aleg=player.GetVar("Aleg");
player.SetVar("urmatorulEcran",urmatorulEcran(aleg));
Aleg is a Storyline variable set by the user interaction in the slide. urmatorulEcran is another Storyline variable that I am hoping to set with my JS function.
urmatorulEcran(aleg) is the function that calculates the next screen according to what the user chose on the slide and other things.
Then I test the value of urmatorulEcran (meaning next screen) and I send the learner accordingly.
However, it does not work (the slide does not change). I tested the JS function outside SL and it works fine.
Any ideas?
Thanks,
Ioana
2 Replies
Nevermind, I figured it out, the variables in Articulate cannot have the same name with the ones in JS.
Hi Ioana and welcome to E-Learning Heroes
Glad that you were able to get this sorted and thanks for sharing.
This discussion is closed. You can start a new discussion or contact Articulate Support.