Storyline 2: Adding Dynamic Slide Numbers Simplified

Sep 16, 2016

This discussion demonstrates how to add dynamic slide numbers to a course within Articulate Storyline 2. And allow you to add, move, and delete slides without affecting the current slide number or slide count.

Remember: Due to local browser security issues JavaScript is not supported in the preview mode, or when viewing the flash version of your course locally. When working with JavaScript in storyline always test your course on a web server.

You should have an understanding of the following:

  • How to create variables
  • Now to navigate the to the slide master
  • How to use the trigger wizard and insert JavaScript
  • How to add variable references to a slide

1. Navigate to the slide master and add the following JavaScript trigger and set it to execute when the timeline start.

// -- Get Player

var player = GetPlayer();

 

// -- get current slide number

// ---- NOTE: Quiz Question must be in the Scene and not Drawn from a Bank

var thisSlideIndex = story.allSlides[player.slideIndex].sceneSlideIndex+1;

player.SetVar("vCurrentSldNum",thisSlideIndex);

 

// -- get Scene Slide Count
var thisSceneSlideCnt = story.allSlides[player.slideIndex].parent.slides.length;
player.SetVar("vScneSldeCnt",thisSceneSlideCnt);

2. Navigate to the triggers panel and create two number type variable for the scene slide number and scene slide count with default value of 0.

vCurrentSldNum
vScneSldeCnt

3. Navigate to each “Slide Master Layout” where you want to display the current slide number and scene slide count. Insert a text box with variable reference for vCurrentSldNum and vScneSldeCnt.
Note: The first variable reference is current slide number and the second is scene slide count.

%vCurrentSldNum% of %vScneSldeCnt%

4. Now publish your storyline course view using HTML 5 output.

30 Replies
Alyssa Gomez

Hi Oliver,

Are you looking to add automatic slide numbers to your slides in Storyline 3?  I know using variables and triggers for this can be cumbersome, and I'm happy to pass along your idea for a built-in feature.  

Hopefully other folks in the community can chime in with their ideas, and in the mean time, the link I shared above should get you started. 😊

Olivier Hanoun

Hi Alyssa,

Thanks for replying.

This is not what I'm looking for (slide numbering). I recently found out that some JS functions are bundled with SL2 to get clue about the slide properties. Unforntunately they are not anymore part of SL3...

My goal is to find a way to make a dynamic branching according to a random integer array that I generate at the beginning of my course. The only way I see is to use JS.

Any idea is of course most welcome!

Olivier

Ashley Terwilliger-Pollard