Copy link to clipboard
Copied
I am looking to make a stopwatch timer in AfterEffects with the Slide Control. I want to display minutes, seconds, and milliseconds (00:00:00). I cannot find the correct source text for it.
This is what I currently have:
slider = Math.round(effect("Slider Control")("Slider"))
sec = slider%60
min = Math.floor(slider/60)
function addZero(n){ if (n<10) return "0" + n else return n }
addZero(min) + ":" + addZero(sec)
Copy link to clipboard
Copied
Try this:
slider = effect("Slider Control")("Slider").value;
function padZero(n){
return (n < 10 ? "0" : "") + n;
}
min = Math.floor((slider%3600)/60);
sec = Math.floor(slider%60);
ms = slider.toFixed(2).substr(-2);
padZero(min) + ":" + padZero(sec) + ":" + ms
Find more inspiration, events, and resources on the new Adobe Community
Explore Now