ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

swap a word with rate control

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Eric Kassel
swap a word with rate control
on May 27, 2015 at 4:23:26 pm

I searched the forums but didn't find quite the answer that I am looking for. I'm working on an animation where there is text on screen (one word), and I'd like to swap out the source text from an array of words (preferably located in an external file) in the order they are in, with the ability to keyframe the rate of change (slider?) so I can speed up the rate of change or stop it completely. I'm new to expressions, but I know that this woud be much easier accomplished through an expression rather than keyframing it. Any help would be appreciated! Thanks!

Return to posts index

Fahd Chishty
Re: swap a word with rate control
on May 28, 2015 at 9:50:42 pm

Hey I just did my research on your problem and came up with a solution.
Following are the steps:
1. Create a text file and place it in D: drive (for ease of access)
2. Add your words in the text file in the following format:
x = ["Courage", "Strength", "Valor", "Dedication", "And So On..."];
3. Save and close the text file.
4. Add Slider Control to your text layer in AE and name it "Change Rate (Speed)"
5. Add the following expression in the Source Text property of your text layer

myPath = "/d/file.txt";
x = $.evalFile (myPath);
rate = time*effect("Change Rate (Speed)")("Slider");
len = x.length;
for(i = 0; i < len; i++)

Hope this solves the issue :)

Fahd Chishty
Motion Design Artist

Return to posts index

Eric Kassel
Re: swap a word with rate control
on May 30, 2015 at 1:00:55 pm

Thanks for the respons! That works! I didn't specify this, but I'd love to have it loop back through the list when it reaches the end so it will never just stop completely. Is that easy to do?

Eric Kassel

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 All Rights Reserved