Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression error although expression works

  • Expression error although expression works

    Posted by Scott Mcgee on May 24, 2018 at 9:31 am

    I get an error saying that speed149, or speed19. I’m guessing it’s doing something based on the frame.

    Even though the expression works fine, I don’t understand why this is flagging an error. Anyone got an explanations as I’m struggling.

    c = Math.floor(time);

    if (c > 0 || c < 2){
    speed1 = 100;
    speed2 = 150;
    eval("speed" + c);

    } else text.sourceText;

    Scott Mcgee replied 8 years, 3 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    May 24, 2018 at 1:13 pm

    I’m not sure if this is what you’re trying to do, but try it this way:


    c = Math.floor(time);

    if (c > 0 && c <= 2){
    speed1 = 100;
    speed2 = 150;
    eval("speed" + c);

    } else text.sourceText;

    Dan

  • Scott Mcgee

    May 24, 2018 at 1:48 pm

    That fixed it, as soon as I saw the && part I thought. *facepalm*

    Cheers that helped.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy