Highlighted

After Effects Expression Error

Community Beginner ,
Sep 24, 2020

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);

Adobe Community Professional
Correct answer by Tomas_Sinkunas | Adobe Community Professional

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";
}
TOPICS
Error or problem, Expressions, FAQ, Resources, Scripting

Views

79

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

After Effects Expression Error

Community Beginner ,
Sep 24, 2020

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);

Adobe Community Professional
Correct answer by Tomas_Sinkunas | Adobe Community Professional

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";
}
TOPICS
Error or problem, Expressions, FAQ, Resources, Scripting

Views

80

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 24, 2020 0
Guide ,
Sep 24, 2020

Copy link to clipboard

Copied

Change the curly quotes around the colon to straight quotes.

 

Dan

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 24, 2020 2
Adobe Community Professional ,
Sep 24, 2020

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";
}

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 24, 2020 2