i know nothing about random...
i used this code...
Code:
random = Number(random(9))+1;
tellTarget ("/mc" add random)
gotoAndPlay(1);
}
then this one...
Code:
r=int(Math.random()*9)+1;
_root["mc"+r].gotoAndPlay(1);
}
im using 79 movieclips...they are tiny sqares but they all are different...
i need to play the animation that each square has (change color) without pressing any button...the first code worked pasting it into a button...but second one dindnt worked....
ah!...and with the first code...i can only play randomly the first 9 MC...and then comes and error of level_0
Last edited by ContactoCreatvo; 12-10-2002 at 11:31 AM .
[contacto creativo]
HELP>>>ACTIONSCRIPT DICTIONARY
Learn dot syntax, it is much easier and will most likely fix up this problem.
Code:
r=int(Math.random()*9)+1;//do not use random as a var name.. it is a reserved word in Flash
_root["mc"+r].gotoAndPlay(1);
Good Luck!
Antibody
"Our deepest fear is not that we are inadequate.
Our deepest fear is that we are powerful beyond measure." - N. Mandela
i paste the code you gave me...
didnt worked..
nothing happens....
HELP>>>ACTIONSCRIPT DICTIONARY
I need to see the .fla. You haven't provided enough information on how your movie works and the location you are placing this code.
You are only going to get movies 1-10 to play because you're random code is only picking numbers between 1 and 10.
Are the movieclips named mc1 ~ mc79 and are they sitting on the _root timeline? or are they inside of another movieclip?
Where are you placing this code in relation to those movieclips?
Please provide your .fla file so that I can help you further.
Good Luck!
Antibody
"Our deepest fear is not that we are inadequate.
Our deepest fear is that we are powerful beyond measure." - N. Mandela
You are only going to get movies 1-10 to play because you're random code is only picking numbers between 1 and 10.
im sending the .fla
Are the movieclips named mc1 ~ mc79 and are they sitting on the _root timeline? or are they inside of another movieclip?
yeap...they are named mc1 ~ mc79 and are sitting on the _root
Where are you placing this code in relation to those movieclips?
im placing the code in a keyframe...
what i need to do is that each square starts the animation randomly so it will look like christmas lights...i cleared the keyframe with the actions
thanx!
Attached Files
HELP>>>ACTIONSCRIPT DICTIONARY
Okay in the .fla that you provided, add this code to frame one of the _root:
Code:
_root.onEnterFrame=function(){
r=int(Math.random()*17)+1;
_root["mc"+r].play();
};
Is this what you are after?
Antibody
"Our deepest fear is not that we are inadequate.
Our deepest fear is that we are powerful beyond measure." - N. Mandela
yeah!!
i was trying to do that
thanx again!
HELP>>>ACTIONSCRIPT DICTIONARY
Cool
Glad to help out.
Antibody
"Our deepest fear is not that we are inadequate.
Our deepest fear is that we are powerful beyond measure." - N. Mandela
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width