Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions swap a word with rate control

  • swap a word with rate control

    Posted by Eric Kassel on May 27, 2015 at 4:23 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!

    Eric Kassel replied 10 years, 11 months ago 2 Members · 2 Replies
  • 2 Replies
  • Fahd Chishty

    May 28, 2015 at 9:50 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;
    x[--len];
    for(i = 0; i < len; i++)
    {
    if((rate>=i)&&(rate<(i+1)))
    x[i];
    }

    Hope this solves the issue 🙂


    Fahd Chishty
    Motion Design Artist

  • Eric Kassel

    May 30, 2015 at 1:00 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
    https://www.erickassel.com

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