Forum Discussion
Actual clock showing actual time
Thanks for helping so much here. It's hugely appreciated.
One thing - on the link you just gave, I can make the clock appear - but no transparent background even if I select transparent. Have you had any luck there?
- OwenHolt5 years agoSuper Hero
Don't be afraid of JavaScript. Here are the steps and the code you need.
- Create a text variable in your project. I named mine "DisplayTime" and gave it a default value of 0:00 for testing but you can leave the default blank.
- Execute JavaScript when the timeline starts, on your first slide. Here is the JavaScript:
// Establish StoryLine player connection
var player=GetPlayer();// Check time, update it every second, send result to StoryLine
var myVar = setInterval(myTimer, 1000);
function myTimer() {
var d = new Date();
var dT = d.toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'});
player.SetVar("DisplayTime", dT);
} - Everywhere you want the time displayed in Storyline, add a text box with your variable's name included between two % signs. Like this: %DisplayTime%
See example here: https://360.articulate.com/review/content/1d37a5f8-f200-450d-a12a-3b37d8043c41/review
Because you are using a text box to display the time, the background will be transparent.
- UychhorngKhan-84 years agoCommunity Member
Thank you so much, Owen. It's really helpful. Would you mind if you could show me how to trigger this DisplayTime to the result slide when the clock reaches 5 pm daily for example?
I have been searching around the community for a while and didn't find the solution yet. Thank you in advance.
- OwenHolt4 years agoSuper Hero
I'm not sure I understand the use case. The use would have to be on your results page at 5:00 to see anything triggered.