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

"This project contains a expression error: error 1 of 1" in After Effect. Help.

New Here ,
Aug 27, 2018 Aug 27, 2018

Copy link to clipboard

Copied

"This project contains a expression error: error 1 of 1" in After Effect. Help.

rateOfSpeed=1;

clockStartTime = thisComp.layer(“slider”).effect(“Slider Control”)(“Slider”)*60;

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'm using to create a timer but there is an error and it dosen't work.

[This post moved to After Effects Scripting by Moderator]

TOPICS
Expressions

Views

2.1K

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
Explorer ,
Sep 08, 2018 Sep 08, 2018

Copy link to clipboard

Copied

Took me like 15 minutes to figure this out. It's your keyboard. Switch it to English. The quotes are not of the correct type. Also, your minus from the third line of code its not a minus. Here is the working code:

rateOfSpeed=1;

clockStartTime =thisComp.layer("slider").effect("Slider Control")("Slider")*60;

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

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
Community Expert ,
Oct 25, 2018 Oct 25, 2018

Copy link to clipboard

Copied

LATEST

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