PDA

View Full Version : random cycling by Thoriphes



soommen
September 28th, 2001, 09:22 AM
Thanks for the Fla. but I am not able to get it to do numbers, only letters! Any ideas to solve this problem?

thoriphes
October 1st, 2001, 06:20 AM
you have to change the range of the chr() values. or actually, i'm stupid, just use a random number generator. and don't forget to change the dynamic text options to choose numbers (the button that looks like 123).

soommen
October 1st, 2001, 08:54 AM
No, no, I'm stupid. Um... what is a random number generator??

thoriphes
October 1st, 2001, 09:17 AM
well, you kinda have to elaborate a lil. there is a function called "random()" where you insert a number and it chooses a number randomly between 0 and the number before the number you put in. it's in my code

sidky76
October 2nd, 2001, 10:40 AM
i dunno if this is what you meant but you can see a couple of random numbers cycling in my footer below. i just modified the random letter cycling tutorial found in this site. i replaced the following lines:

onClipEvent (enterFrame) {
if (go) {
x = random(122);
if ((x>=65) and (x<=122)) {
this.letter2 = chr(x);
}
if (x == 65) {
go = false;
}
}


with these lines:

onClipEvent (enterFrame) {
if (go) {
x = random(10);
this.number2 = x;
}
}


p.s.
thanks to thoriphes for the original code.

soommen
October 2nd, 2001, 03:08 PM
Thanks, both your comments are helpful. Cool intro on your site Sidky.