ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

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

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Assaf Goldlust
Alpply while/do loop to a text layers, see no characters... why?
on May 16, 2018 at 11:01:27 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?


Return to posts index

Dan Ebberts
Re: Alpply while/do loop to a text layers, see no characters... why?
on May 16, 2018 at 1:39:20 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



Return to posts index

Assaf Goldlust
Re: Alpply while/do loop to a text layers, see no characters... why?
on May 19, 2018 at 10:03:51 am

still dont work


Return to posts index


Assaf Goldlust
Re: Alpply while/do loop to a text layers, see no characters... why?
on May 21, 2018 at 2:59:18 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


Return to posts index

Dan Ebberts
Re: Alpply while/do loop to a text layers, see no characters... why?
on May 21, 2018 at 3:28:33 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



Return to posts index

Assaf Goldlust
Re: Alpply while/do loop to a text layers, see no characters... why?
on May 21, 2018 at 3:46:19 pm

i recorded a video so you can see for yourself.







Return to posts index


Dan Ebberts
Re: Alpply while/do loop to a text layers, see no characters... why?
on May 21, 2018 at 4:01:03 pm

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

Dan



Return to posts index

Assaf Goldlust
Re: Alpply while/do loop to a text layers, see no characters... why?
on May 21, 2018 at 4:03:58 pm

yes, still same result :(


Return to posts index

Assaf Goldlust
Re: Alpply while/do loop to a text layers, see no characters... why?
on May 21, 2018 at 4:06:39 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


Return to posts index


Dan Ebberts
Re: Alpply while/do loop to a text layers, see no characters... why?
on May 21, 2018 at 7:36:42 pm

Can you post a simple project file demonstrating the problem?

Dan



Return to posts index

Assaf Goldlust
Re: Alpply while/do loop to a text layers, see no characters... why?
on May 22, 2018 at 1:12:16 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?


Return to posts index

Dan Ebberts
Re: Alpply while/do loop to a text layers, see no characters... why?
on May 22, 2018 at 3:08:54 am

The myText variable is initially an empty string, and the loop appends one random character at a time until it is 500 characters long, and then it's the result of the expression. Is that what you mean?

Dan



Return to posts index


Assaf Goldlust
Re: Alpply while/do loop to a text layers, see no characters... why?
on May 22, 2018 at 2:40:50 pm

this is the quote from the boook




Return to posts index

Assaf Goldlust
Re: Alpply while/do loop to a text layers, see no characters... why?
on May 22, 2018 at 2:42:14 pm

this is what im trying to figure out why


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]