Activity › Forums › Adobe After Effects Expressions › Blink word in sentence
-
Blink word in sentence
Posted by Navarro Parker on April 5, 2013 at 10:52 pmHow could you make an individual word in a sentence blink? I’m thinking using the text word index?
Kalleheikki Kannisto replied 5 years, 4 months ago 4 Members · 15 Replies -
15 Replies
-
Dan Ebberts
April 6, 2013 at 12:19 amOne way:
Add an Opacity Animator and set the Opacity value to 0.
Add an Expression Selector and delete the Range Selector.
Set the Based On parameter to “Words”
Add an expression like this to Amount parameter:
wordIndexToBlink = 3;
freq = 1;if (textIndex == wordIndexToBlink){
seg = Math.floor((time - inPoint)*freq*2);
if (seg%2) 100 else 0
}else 0
Dan
-
Navarro Parker
April 6, 2013 at 9:04 pmWorks like a charm! Thanks! I didn’t even know text had a parameter for expressions like that.
Would it be possible to add a “blink x number of times, then stay solid” feature into that?
-
Dan Ebberts
April 6, 2013 at 10:24 pmLike this:
wordIndexToBlink = 3;
numBlinks = 5;
freq = 1;
if (textIndex == wordIndexToBlink){
seg = Math.floor((time - inPoint)*freq*2);
if (seg < numBlinks*2)
if (seg%2) 100 else 0
else
0
}else
0
Dan
-
Navarro Parker
April 6, 2013 at 11:00 pmOk, I’m impressed! So cool!
Just curious is it possible for wordIndexToBlink to contain more than one value?
Like:
wordIndexToBlink = 1,5 (words 1 and 5)
or
wordIndexToBlink = 2~4 (words 2 through 4) -
Dan Ebberts
April 6, 2013 at 11:40 pmOne way:
wordIndexToBlink = [2,3,4];
numBlinks = 5;
freq = 1;
blinkMe = false;
for (i = 0; i < wordIndexToBlink.length; i++){
if (wordIndexToBlink[i] == textIndex){
blinkMe = true;
break;
}
}
if (blinkMe){
seg = Math.floor((time - inPoint)*freq*2);
if (seg < numBlinks*2)
if (seg%2) 100 else 0
else
0
}else
0
Dan
-
Aqeel Arruhaili
May 4, 2019 at 12:03 pmI am using after effects 2019 but when I used the expressions mentioned here..i got a wrong message and I couldn’t solve it…
Syntax Error: Unexpected token else -
Dan Ebberts
May 4, 2019 at 3:38 pmTry changing this line:
if (seg%2) 100 else 0
to this:
(seg%2) ? 100 : 0
Dan
-
Aqeel Arruhaili
May 4, 2019 at 4:49 pmI got a different mistake message
Syntax Error :Unexpected token ?
Reply to this Discussion! Login or Sign Up