Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects After Effects Text Animation – Display Words one after another

  • Peter Band

    January 19, 2021 at 12:40 am

    I was looking for a way to display one word at a time in the same place and came across Walter’s expression – it worked great.

    Now I am looking to adjust the duration / how long a word is displayed based on its length (number of letters in the word). I tried pre-composing and time-remapping but to no avail.

    I know that I can get the number of letters of a word by using layer.text.sourceText.length. But how could I go about using that as a delay or factor to influence how long the word is displayed?

  • Fabrice Leconte

    January 19, 2021 at 4:05 am

    Based on word length.

    t = value.split(' ');

    w = 0;

    c = 0;

    for (i = 0; i < t.length; i++) {

    if (c < time) {

    c += t[i].length;

    w = i;

    }

    }

    linear(time, time, c, t[w],t[w])

  • Peter Band

    January 19, 2021 at 3:02 pm

    Thank you for your response Fabrice.

    It’s not working in my AE (2020). I am getting the expression error “Couldn’t turn result into numeric value” in the first line. I am only getting this error once I put in the for() loop. Seems like a data type issue. I tried parseInt() but didn’t have any luck with that.

  • Fabrice Leconte

    January 19, 2021 at 4:45 pm

    OK, sorry I tried with a numeric string such as:

    “1 22 333 4444 55555”

    For a string, use:

    t = value.split(' ');

    w = 0;

    c = 0;

    for (i = 0; i < t.length; i++) {

    if (c < time) {

    c += t[i].length;

    w = i;

    }

    }

    t[w]

  • Peter Band

    January 19, 2021 at 5:08 pm

    Thanks! This is working great.

    I inserted another variable to control the overall speed. Now I am wondering how to define a minimum duration for each word to be displayed.

    t = value.split(' ');

    w = 0;

    c = 0;

    speedFactor = 0.5;

    for (i = 0; i < t.length; i++) {

    if (c < time) {

    c += t[i].length*speedFactor;

    w = i;

    }

    }

    t[w]

  • Fabrice Leconte

    January 19, 2021 at 10:52 pm

    Use Math.max()

    t = value.split(' ');

    w = 0;

    c = 0;

    speedFactor = 0.5;

    minDur = 2;

    for (i = 0; i < t.length; i++) {

    if (c < time) {

    c += Math.max(t[i].length*speedFactor,minDur);

    w = i;

    }

    }

    t[w]

  • Guto Bernardo

    April 29, 2021 at 3:22 am

    this helped me so much!! thx

Page 2 of 2

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