Random Frame

How do you make the screen go to a random frame that is inside a movie clip?

Howdy…

Create a random number and store it to the variable…

Use _level0.yourMC.gotoAndPlay(yourRandomVariable) or _level0.yourMC.gotoAndStop(yourRandomVariable) to do the job…

Easy, eh??? :slight_smile:

tip.

[url=http://www.kirupaforum.com/search.php?s=]
:wink:

onClipEvent(event you want) {
this. gotoAndPlay(1+Math.round(Math.random()*random number));
}

Originally posted by fluid_0ne
onClipEvent(event you want) {
this. gotoAndPlay(1+Math.round(Math.random()*random number));
}

onClipEvent (event you want) {
	this.gotoAndPlay(Math.ceil(Math.random()*this._totalframes));
}

:wink:

[size=1]edit. typo !![/size]

yeah, i knew it all tha time ;P:cowboy:

then why would you use 1+Math.round() ?? :stuck_out_tongue: :wink:

i was in such a hurry, U would never guess :stuck_out_tongue_winking_eye:

interesting … :sigh:

ok, 4 real i wasn’t thinking what i’m writing… i just wrote what i though :+)