Forum Discussion
ToniGaunson
2 years agoCommunity Member
Adding a digital clock with HH:MM:SS displaying to storyline
I'm working on a course that has a digital display screen for a vehicle. We've managed to mimic the digital display which pops up with alerts that display a time as they appear. Rather than just use...
JohnCooper-be3c
2 years agoCommunity Member
Hi - Great question.
I may be able to help - we are just developing/testing a 'real-time' clock for use in Storyline. It appears to work OK - but still testing
RealtimeClock (profilelearning.com)
The key bit of JavaScript you need is this:
const date = new Date();
const time = date.toTimeString();
const hours = time.substring(0,2);
const minutes = time.substring(3,5);
const seconds = time.substring(6,8);
//Get Player and set variables
var player = GetPlayer();
player.SetVar("H",hours);
player.SetVar("M",minutes);
player.SetVar("S",seconds);
This assumes you have three string variables "H", "M" and "S" defined in your Storyline Code.
- ToniGaunson2 years agoCommunity Member
Thanks John. This is great. I'll give this a definite go.