Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Define Case in Switch statements

  • Define Case in Switch statements

    Posted by Christian Simpson on September 27, 2017 at 9:50 pm

    Instead of having my expression use the number of the layer in the pop up drop down how can I have it use the name of the item in the drop down. For example I don’t want the expression below to use the number but the actual text for the case. So the case would be Air Force, Akron, and Alabama for example.

    var num = comp("test comp").layer("Null 2").effect("Home Team")
    ("Home Team").value;
    switch(num) {
    case Air Force:
    theText = "Air Force";
    break;
    case 2:
    theText = "Akron";
    break;
    case 3:
    theText = "Alabama"
    break;
    default:
    theText = "Team Name"
    }
    theText

    Dan Ebberts replied 8 years, 11 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    September 27, 2017 at 10:23 pm

    As far as I know, there’s no way for an expression to access the text associated with a dropdown selection.

    Dan

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