Name and Date Variables on Master Slide

Apr 02, 2017

Hi,

I am a newbie to Storyline 2. I would like to display current date and time on every slide.

I tried to set a text box with a variable %dateandtime% on slidemaster.

I execute the below javascript when timeline starts to act on a text object callef TxtDateAndTime.

var rawDate = new Date();
var p = GetPlayer();
p.SetVar("dateandtime",rawDate);

However, I notice that i can only see %dateandtime%  rather than the expected date and time. Any help on what i am doing wrong?

Thanks,

Vj

4 Replies
Walt Hamilton

I'm not totally certain, but I expect that the master slide never executes. It serves as a template for creating new slides, but it never executes. I think if the javascript is placed on the first slide, it will set the variables, and in SL, variables are global, so you should be all right.

This is all dependent on you creating the dateandtime variable in SL. If you are seeing the actual "%dateandtime%" on your slides, that indicates that the variable doesn't exist. Otherwise, it should be blank.

This discussion is closed. You can start a new discussion or contact Articulate Support.