-
Countdown from 90 seconds. Not 1:30
Hi team, I am trying to create a time accurate 90 second countdown using expression. This can’t be done with Effect Controls, as it must feed into Element after so it must be script driven. The final look should be 90:00 where the left 2 digits are seconds and the right 2 digits are milliseconds. The script i have been playing with unfortunately gives me 01:30:00. Please see attached script and feedback would be highly appreciated.
countspeed = 60;
clockStart = 120 * countspeed * -1;function times(n) {
if (n < 10) return "0" + n else return "" + n
}clockTime = clockStart + countspeed * (time - inPoint);
if (clockTime < 0) {
minus = ""; clockTime = -clockTime;
} else {
minus = "";
}t = Math.floor(clockTime);
h = Math.floor(t/3600);
min = Math.floor((t%3600)/60);
sec = Math.floor(t%60);
ms = clockTime.toFixed(3).substr(-3);
minus + times(h) + ":" + times(min) + ":" + times(sec)