Page 1 of 1

Alpply while/do loop to a text layers, see no characters

PostPosted: 05/21/2018, 9:28 am
by hunter111
im learning expressions with the book "AE Expressions" by Marcus Geduld.

i have reached the lessons about "while/do loops"

and i encountered a challenge:

in the book he was using the following expressions on the Source text property to generate a bunch of random characters
that keeps changing.

the expression:

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


but when i did the same i got nothing. literraly all i got was an empty comp.

i also cuptured a video so you can see for yourselfs

https://www.youtube.com/watch?v=-bxgUiCEobQ


so i need some help understanding why is this happening how to fix it.
can anyone help?

Re: Alpply while/do loop to a text layers, see no characters

PostPosted: 05/23/2018, 12:58 am
by Gerry Clark
It works for me.
I created a text layer with the word "Text" in it.
Copied the expression you posted.
Pasted it into "Source text" of the layer "Text".
No problem. Random characters on a single line.

Re: Alpply while/do loop to a text layers, see no characters

PostPosted: 05/26/2018, 2:17 am
by star+circle
One possible reason: a small text box with large characters that don't fit in it.