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 amStudying from the book “AE expressions”.
I have reached the chapter about loops.In the book he applies the following expression.
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 pmIt 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 21, 2018 at 2:59 pmi 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 pmI 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 pmi 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 pmThat’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:06 pmit 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 pmCan you post a simple project file demonstrating the problem?
Dan
-
Assaf Goldlust
May 22, 2018 at 1:12 amActually 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 expressionsmy text need to have this variable
var myText = "";
but i still need to know why?
Reply to this Discussion! Login or Sign Up
