Forum Discussion
Jump to Slide %Variable%
Note: Since Articulate doesn't officially support JavaScript, this could change in the future, but...
Jumping around via variables requires JavaScript. Articulate has exposed the JumpToSlide() method under GetPlayer().
On any given Storyline slide, the built-in variable Slide.Id holds the slide ID. Record the IDs of the slides you want to use and assign them, as needed, to a variable named slideID.
From JavaScript, inside a trigger, fetch the value of slideID from Storyline:
var slideID = GetPlayer().GetVar("slideID");
then, jump to your desired slide:
GetPlayer().JumpToSlide(slideID);
Nathan. thanks for your input. But I can't seem to retrieve any built-in variables whatsoever. I can retrieve project variables using GetVar. All built-in variables return NULL values.
var player = GetPlayer();
var anyVariable = player.GetVar("Slide.Id");
alert( anyVariable );
The built-in variable for the slide ID is "Slide.Id" that returns NULL. I have tried other built-in variables and all return NULL.
If I use a project variable, it works correctly. Any idea why I can't retrieve built-in variables with JavaScript? I can retrieve those variables slides by typing %Slide.Id%
Thanks
- Nathan_Hilliard2 months agoCommunity Member
I don't think you can (or I don't know how) in JavaScript. To read or assign a built-in variable, you need to do it via a trigger in Storyline. That's why I suggested creating new variable slideID in SL. Set it equal to Slide.Id in a trigger, or set the value manually. You can also manually set up an array of text values in JavaScript and set it there.
- GarrisonWilliam2 months agoCommunity Member
How do you set a project variable equal to the value of a built-in variable?
- Nathan_Hilliard2 months agoCommunity Member