If i use the Html code, you offer me in the first response, into an Html widget, i don’t understand how i can allow to start the countdown timer if i push over the button which do start the animation to count.
Here’s a version that has that countdown script within the inner HTML of an element, and it is set to start at 1 second into the main timeline (in the second scene):
This technique uses inner HTML key framing: If you modify the inner HTML of an element while recording, you can change the inner HTML at a specific time on a timeline.
Going up is easily done by changing “seconds–” to “seconds++” but what you are asking if I’m understanding correctly is that you want a timer to show 0 - 3hrs within 10 seconds?
Put this in a new function and call it at the beginning of the timeline.
var seconds = 0;
var display = hypeDocument.getElementById('display'); // this is your element that you want to display the time in.
window.time = setInterval( function () {
seconds = Math.round(seconds) + 9;
var minutes = Math.floor((seconds)/60);
var hours = Math.floor(seconds/3600);
var minsRemain = minutes % 60;
if (minsRemain < 10) {
minsRemain = "0" + minsRemain;
}
var secondsRemain = seconds % 60;
if (secondsRemain < 10) {
secondsRemain = "0" + secondsRemain;
}
display.innerHTML = hours + ":" + minsRemain + ":" + secondsRemain;
if (seconds >= 10800) {
clearInterval(time);
}
}, 1/100);
Put this in another New Function and add it at the end of your timeline (10 seconds):
The element is an object you place within your scene. The function just references this. It can be any object you want. A rectangle, a Circle but I would use a text element. But give it an ID using the inspector. You could use whatever you want as an ID as long as you put that in the function. For ease, I would stick with “display” as an ID.
Ah Ok I got it now, I found where you change the element id copied the same function for a different display name and both timers work. But only ONE stops at 2:59.51 and the other keeps going , I see a stop function as well how do I add that correctly?
And last I need one timer to go to 3 hours in a little less time like 5 seconds and the second timer to go to 9 hours in 10 seconds then I’m done. thx so much