FORUMS: list search recent posts

AE countdowntimer - miliseconds count up in stead

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Lene Conradsen
AE countdowntimer - miliseconds count up in stead
on Aug 26, 2019 at 1:56:44 pm

Hi,

Im having some trouble with a countdown timer, I've made. Everything works except the miliseconds. They count upwards in stead. I've used this code:

function padZero(n){
s = "" + n;
if (s.length < 2) return ("0"+s);
return s;
}
dayStart = 0;
hrStart = 14;
minStart = 55;
secStart = 00;
msStart = 0;

clockRate = 1;

totalStartSec = ((dayStart*24 + hrStart)*60 + minStart)*60 + secStart;
curTotalSec = totalStartSec - Math.round((time - inPoint)*clockRate);

curDay = Math.floor(curTotalSec/(24*3600));
curHr = Math.floor((curTotalSec%(24*3600))/3600);
curMin = Math.floor((curTotalSec%3600)/60);
curSec = curTotalSec%60;
curMs = time.toFixed(2).substr(-2);

padZero(curHr) + ":" + padZero(curMin) + ":" + padZero(curSec) + ":" + padZero(curMs);


Does anyone have a fix? Thanks!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]