# 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

As i dont know much action script

Samster.

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:

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

does anyone know y?

[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