Forum Discussion

EsmeraldaBar868's avatar
EsmeraldaBar868
Community Member
4 months ago

How to Jump to a certain slide using Javascript

 Hello! I need to Jump to a certain slide using Javascript, however methods listed back in 2013 for Player object seems to be not working anymore, like player.setSlideIndex(index)

Perhaps, I'm doing something wrong?

 var player = GetPlayer();

player.setSlideIndex(1.37)?

  • AndrewHanley's avatar
    AndrewHanley
    Community Member

    You could just use JS to set a Storyline variable value.

    Then a simple "when variable changes..." trigger would immediately jump to whatever slide is called.

    You could even put that trigger on the Master slide if you want it to happen on every single slide.

  • Thanks!

    I have a timer that is only active on certain slides. The timer itself is a SetInterval method. 

    What I'm trying to do is to JumpToSlide from the function, but I can't find the correct method for Player, which does that. 

    The idea is to avoid putting the trigger on each slide I need (about 20) or on the Master slide which will affect the whole project in my case.