Creating a stopwatch/timer

Aug 20, 2015

Hi,

I am working on creating a video that I will most likely insert into Storyline2. I need to have a stopwatch begin at a certain point and then stop at a certain point so that people who are viewing the video know that at 2 minutes into the scenario this happened, 10 minutes in this happened and so on.

So, my question...how can I built such a stopwatch/timer????

5 Replies
Alexandros Anoyatis

Hi Rhona,

Short answer is "Yes you can". Here's how:

1) Create a number variable, say timer
2) Create a JS trigger at the time you want the timer to start and add the following code:

var player = GetPlayer();
var myVar=setInterval(function () {myTimer()}, 1000);

function myTimer() {
var s = player.GetVar("timer");
++s;
player.SetVar("timer",s);
}

This will initialize a function that adds 1 to timer every 1 second

3) Add necessary triggers to stop the timeline (or show/record whatever it is you want) when timer equals 120 and another when timer equals 600.

There's more you can/should do depending on the exact functionality you're going for which isn't really clear from your description.

Hope this helps,
Alex

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