Copy link to clipboard
Copied
rateOfSpeed=1;
clockStartTime = thisComp.layer("TImer Duration").effect("Slider Control")("Slider")*3600;
ClockTimeNumber = Math.floor(clockStartTime-rateOfSpeed*time);
function addZero(n){
if(n<10) {return "0" + n}else{return n};
}
minutes = Math.floor(clockTimeNumber/60);
seconds = clockTimeNumber%60;
if (clockStartTime > 0 && time < clockStartTime) {
addZero(minutes) + “:” + addZero(seconds);
}
else
{“00:00”}
This is the code, I copied it from a video. And then customize it according to my need. But I am getting error in the following line of code "Syntax Error" reference code: addZero(minutes) + “:” + addZero(seconds);
Change the curly quotes around the colon to straight quotes.
Dan
What @Dan_Ebbers said - you have Rich Text quotes, and they need to be converted to regular quotes, singe or double.
if (clockStartTime > 0 && time < clockStartTime) {
addZero(minutes) + ": " + addZero(seconds);
} else {
"00: 00";
}
Copy link to clipboard
Copied
Change the curly quotes around the colon to straight quotes.
Dan
Copy link to clipboard
Copied
What @Dan_Ebbers said - you have Rich Text quotes, and they need to be converted to regular quotes, singe or double.
if (clockStartTime > 0 && time < clockStartTime) {
addZero(minutes) + ": " + addZero(seconds);
} else {
"00: 00";
}