Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Text expression selector

  • Text expression selector

    Posted by Ken Kwong on June 15, 2020 at 9:22 pm

    Guys, I have been experimenting the text animation expression selector. But there’s one thing I cannot figure out.

    Let’s say I have an array:
    myArray=[3,10,17,20]
    and the array might get longer based on the situation

    I need to apply the color fill on textIndex 3-10 and 17-20 but I couldn’t figure out the code for that.
    Any though how I can achieve this…

    Thank you in advance!

    Ken Kwong replied 6 years, 2 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    June 15, 2020 at 9:59 pm

    Try this:


    myArray = [3,10,17,20];
    included = false;
    for (i = 0; i < myArray.length; i += 2){
    if (i < myArray.length-1){
    if (textIndex >= myArray[i] && textIndex <= myArray[i+1]){
    included = true;
    break;
    }
    }
    }
    included ? 100 : 0

    Dan

  • Ken Kwong

    June 15, 2020 at 10:36 pm

    This is totally gorgeous.
    Thank you for the quick help Dan!

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