-
Precise Number 10 Second Countdown
I know there are plenty of countdown posts, but I couldn’t find this exact problem.
I need to create a number countdown for an academy leader. It needs to be 10 seconds long and count down from 10 to 1.
Here’s my problem, so far the scripts I’ve tried and the “numbers” effect have not created an exact 10 second countdown. I can get it to start with 10 and end on 1 but, I need each number to stay on for 1 second each.
I saw a comment somewhere that said to use: math.ceil for a precise count, but I couldn’t figure it out. I also tried taking a money count script and altering it, but again it is not precise.
Any clues?
numDecimals = 0;
commas = true;
dollarSign = 0;
beginCount = 10;
endCount = 1;
dur = 10;t = time - inPoint;
s = linear (t, 0, dur, beginCount, endCount).toFixed(numDecimals);prefix = "";
if (s[0] == "-"){
prefix = "-";
s = s.substr(1);
}
if(dollarSign) prefix += "$";if (commas){
decimals = "";
if (numDecimals > 0){
decimals = s.substr(-(numDecimals + 1));
s = s.substr(0,s.length - (numDecimals + 1));
}
outStr = s.substr(-s.length, (s.length-1)%3 +1);
for (i = Math.floor((s.length-1)/3); i > 0; i--){
outStr += "," + s.substr(-i*3,3);
}
prefix + outStr + decimals;
}else{
prefix + s;
}