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
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.
Hm, this works for me. See attached a quick test.
Thanks Michael,
Whilst your version works; I was unable to recreate the same for my own story even after multiple attempts.
I feel like i am doing something wrong. :0(
Do you set up variable on the first slide as mentioned by Walt? What are the steps/sequence required?
Hi Vijay, can you share your .story file here so that someone can have a closer look?
This discussion is closed. You can start a new discussion or contact Articulate Support.