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

Scripting for After Effects

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

Postby hunter111 on 05/21/2018, 9:28 am

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?
hunter111
 
Posts: 91
Joined: 06/2/2011, 3:24 pm

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

Postby Gerry Clark on 05/23/2018, 12:58 am

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.
Gerry Clark
 
Posts: 148
Joined: 07/3/2009, 6:31 am

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

Postby star+circle on 05/26/2018, 2:17 am

One possible reason: a small text box with large characters that don't fit in it.
star+circle
 
Posts: 851
Joined: 12/6/2014, 3:07 pm
Location: Finland


Return to After Effects Expressions