Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Using if condition more than 3 times

  • Using if condition more than 3 times

    Posted by Adam Levine on September 3, 2015 at 5:35 pm

    I’ve created a shape layer and I want to change it’s position using a slider control like in the image.

    But that code don’t work. Please any help.
    ps sorry for my english 🙂

    Adam Levine replied 10 years, 11 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    September 3, 2015 at 5:59 pm

    I think I’d do something like this:

    a = Math.round(effect(“Pos”)(1));
    [value[0],a*100]

    Dan

  • Adam Levine

    September 3, 2015 at 6:09 pm

    Thank you master Dan for your quick reply… But that y positions are not proper values. values in the image are just examples.
    I want some y pos values like this,
    [value [0], 145]
    [value [0], 251]
    [value [0], 364]
    [value [0], 433]
    [value [0], 583] like that. So can you give any idea.
    Thanks again.

  • Dan Ebberts

    September 3, 2015 at 7:42 pm

    Like this then, maybe:


    a = Math.round(effect("Pos")(1));
    switch(a){
    case 1:
    v = [value [0], 145];
    break;
    case 2:
    v = [value [0], 251];
    break;
    case 3:
    v = [value [0], 364];
    break;
    case 4:
    v = [value [0], 433];
    break;
    case 5:
    v = [value [0], 583];
    break;
    default:
    v = [value [0], 0];
    break;
    }

    Dan

  • Adam Levine

    September 3, 2015 at 9:13 pm

    Thank you master Dan. You save my day.. 🙂

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