FORUMS: list search recent posts

Text expression selector

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Ken Kwong
Text expression selector
on Jun 15, 2020 at 9:22:56 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!


Return to posts index

Dan Ebberts
Re: Text expression selector
on Jun 15, 2020 at 9:59:17 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



Return to posts index

Ken Kwong
Re: Text expression selector
on Jun 15, 2020 at 10:36:52 pm

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


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]