Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Alpply while/do loop to a text layers, see no characters… why?

  • Alpply while/do loop to a text layers, see no characters… why?

    Posted by Assaf Goldlust on May 16, 2018 at 11:01 am

    Studying from the book “AE expressions”.
    I have reached the chapter about loops.

    In the book he applies the following expression.

    7

    The idea is to get a bunch of caharacters that change randomly wothing a certain range of ASCII code.

    I tried to do the same thing
    But for some reason my text layer gets completely blank.

    Any ideas for why and how to fix it?

    Assaf Goldlust replied 7 years, 12 months ago 2 Members · 13 Replies
  • 13 Replies
  • Dan Ebberts

    May 16, 2018 at 1:39 pm

    It looks like there are some extra spaces in there. Try it this way:


    posterizeTime(3);
    var myText = "";
    i = 0;
    while(i < 500)
    {
    var randomNumber = random( 48 , 122);
    myText += String.fromCharCode(randomNumber);
    i++;
    }
    myText

    Dan

  • Assaf Goldlust

    May 19, 2018 at 10:03 am

    still dont work

  • Assaf Goldlust

    May 21, 2018 at 2:59 pm

    i tried to do that with the code you wrote.
    but i still got the same result.
    please, i really need to understand why it doesn’t work and how to fix it

  • Dan Ebberts

    May 21, 2018 at 3:28 pm

    I just copied and pasted that code into the Source Text property of a text layer and it works as I would expect it to. What happens when you do that?

    Dan

  • Assaf Goldlust

    May 21, 2018 at 3:46 pm

    i recorded a video so you can see for yourself.

    https://www.youtube.com/watch?v=-bxgUiCEobQ&feature=youtu.be

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

  • Dan Ebberts

    May 21, 2018 at 4:01 pm

    That’s strange. So if you start with a text layer that has actual text, then apply the expression, same result?

    Dan

  • Assaf Goldlust

    May 21, 2018 at 4:03 pm

    yes, still same result 🙁

  • Assaf Goldlust

    May 21, 2018 at 4:06 pm

    it might be important to note:
    its happend to me also on another computer with a diffrent version of after effect.

    so i think we can rule out the possibility of a bug

  • Dan Ebberts

    May 21, 2018 at 7:36 pm

    Can you post a simple project file demonstrating the problem?

    Dan

  • Assaf Goldlust

    May 22, 2018 at 1:12 am

    Actually i was able to make it work.
    i dont knkw why yet but appearently its working great when im doing it on my CS6 version.
    so the problem is not with the expression.

    but there is another thing i wish to understand.
    in the book he stated that for this expressions

    my text need to have this variable

    var myText = "";

    but i still need to know why?

Page 1 of 2

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