• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

After Effects Expression Error

Community Beginner ,
Sep 24, 2020 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);

TOPICS
Error or problem , Expressions , FAQ , Resources , Scripting

Views

784

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
community guidelines

correct answers 2 Correct answers

Community Expert , Sep 24, 2020 Sep 24, 2020

Change the curly quotes around the colon to straight quotes.

 

Dan

Votes

Translate

Translate
Advocate , Sep 24, 2020 Sep 24, 2020

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

Votes

Translate

Translate
Community Expert ,
Sep 24, 2020 Sep 24, 2020

Copy link to clipboard

Copied

Change the curly quotes around the colon to straight quotes.

 

Dan

Votes

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
community guidelines
Advocate ,
Sep 24, 2020 Sep 24, 2020

Copy link to clipboard

Copied

LATEST

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

Votes

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
community guidelines