Page 1 of 1

Random ones and zeros

Posted: November 20th, 2008, 4:24 pm
by SteveB
Is there a simple expression (or not so simple) that randomly changes a string of ones and zeros back and forth? I've seen a few articles that sort of explain this, but they're much more involved than I need.

Re: Random ones and zeros

Posted: November 21st, 2008, 6:41 am
by Atomic
Isn't there an animation preset for doing that with text?

Re: Random ones and zeros

Posted: November 21st, 2008, 8:34 am
by SteveB
I looked, but wasn't able to find one.

Re: Random ones and zeros

Posted: November 21st, 2008, 8:52 am
by SteveB
Thanks Atomic, but I've finally found a solution on the Creative Cow forum:
http://forums.creativecow.net/readpost/2/930650
Thanks to Darby Edelen.

Re: Random ones and zeros

Posted: November 21st, 2008, 9:00 am
by Paul Tuersley
I tried making a text layer with a row of zeros, adding a Wiggly selector and setting the Character Offset to 1, but this caused the numbers to switch between 0,1 and 9.
EDIT: As explained in the Creative Cow post mentioned above, you need to change the Min Amount value from -100 to 0 for this to work.

Alternatively, here's an expression you can apply to a text layer's Source Text property:

Code: Select all

framesPerSecond = 25;
numberOfCharacters = 10;

posterizeTime(framesPerSecond);
result = "";
for (x=1; x <= numberOfCharacters; x++) {
	result += Math.round(random(0,1));
}
result;

Re: Random ones and zeros

Posted: November 21st, 2008, 9:09 am
by SteveB
Thanks. That seems to work real well, too.