Random Numbers

How Do I Play A Movie Clip Randomly. What is the code for it
Its For www.geocities.com/thesamsters/Dudes.swf
One of the tutorials Is to Create random Numbers
But you dont acctually see the random numbers How Would i Put a Input box Or something FOr THe Random Numbers To Appear In.

And Can You Help Me

Plz help me :slight_smile: :slight_smile:

As i dont know much action script

Samster. :slight_smile:

for a text box, it has to be dynamic for you to change the text in it on the fly. Give the dynamic text box a variable name. (bottom right of properties panel) AND in your script, set that variable nam to equal what you want it to say. Ex:

info = “Your mom”;
myTextBox = info;

The dynamic text box will then display the variable info, which obviously says “your mom”.

  • no offense, that’s just my default text saying.

as far as the random movieclip question, i think you have to make an array with those mc’s in it. Then write a code that randomly selects one. Ex:

myArray = new Array()
myArray[0] = blueMC
myArray[1] = whiteMC
myArray[2] = greenMC ////// and so on.

I can’t think of the random code right now, but i’m sure someone else will give it a try. Good Luck

THX AALOT !!!
So Will It look Like THis ??
on (release) {

Math.floor(Math.random() * (high - low))

  • low;

Math.floor(Math.random() * (67 - 10))

  • 10;

info = “Random Number”;
myTextBox = info;

}

That Doesnt Seem To Work In THe Dynamic Text Box
It COmes Up With .level Math.Random
:frowning:
does anyone know y?

How about this:

[AS]
x = Math.floor(Math.random() * 10);
myTextBox.text = 'Random number = ’ + x;
[/AS]

shouuld i just write that for the action ofthe button ?

I dont think it works /

[AS]on(press)
{

x = Math.floor(Math.random() * 10);
myTextBox.text = 'Randomnumber = ’ + x;

} [/AS]

My code wil put the text "Random number = " and a random number from 0 to 9 in a dynamic text box with the instance name myTextBox.

That’s not what you asked in your first post, but I thought that was what you were trying to accomplish in your second post.

And my code works. I’ve tested it.

oh sorry i was doing something wrong
Doh! thx for your help

and your file is offline

its ment to be www.geocities.com/thesamsters/Dude.swf Btw
lol
Thx For YOur Helps