FORUMS: list search recent posts

# After Effects expression "Expecting: ;" or "Expecting: )"error.

FAQ   •   VIEW ALL
 After Effects expression "Expecting: ;" or "Expecting: )"error. on Oct 31, 2014 at 11:56:01 am

i take the error for first else loop which is in line 6 in my After Effects. if there is more error in code i dont know its because i cant pass 6.line. help please.

A = timeToFrames(t = time + thisComp.displayStartTime, fps = 1.0 / thisComp.frameDuration, isDuration = false);

if (A< 20) {y =A/4}

else {
if(A<40) {y=3A/4} else {
if(A<60) {y=A/2} else {
if(A<80) {y=(3A-40)/2} else {
if(A<100) {y=3A/4} else{y=(5A-200)/4} }}}};

[y,y]

 Re: After Effects expression "Expecting: ;" or "Expecting: )"error.on Oct 31, 2014 at 5:54:57 pmLast Edited By Brian Charles on Oct 31, 2014 at 8:24:03 pm

What exactly are you trying to achieve with this code?

It looks like time remapping but results in a 2 dimensional array – time remapping needs a single value, not 2.

What is 3A, it is never defined in the expression?

Could a switch statement better serve your requirements.

 Re: After Effects expression "Expecting: ;" or "Expecting: )"error.on Oct 31, 2014 at 9:24:00 pm

yep, the problem is 3A... i think you may have meant 3*A..?

also you could use 'else if' statements which would simplify your expression a little.

```A = timeToFrames(t = time + thisComp.displayStartTime, fps = 1.0 / thisComp.frameDuration, isDuration = false); if (A<20) y =A/4; else if(A<40) y=3*A/4; else if(A<60) y=A/2; else if(A<80) y=(3*A-40)/2; else if(A<100) y=3*A/4; else y=(5*A-200)/4; [y,y]```

Kevin Camp
Art Director
KCPQ, KZJO & KRCW