The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.

Help with Flash Action script for a Random Movie

IronChefIronChef Registered User regular
edited May 2011 in Help / Advice Forum
Hey guys,

Pretty rudimentary with Flash, so any help with my script would be appreciated.

I am basically trying to get my flash to play a random key frame on each reload of my webpage.

I am currently this far:

stop();
var framesArr = [4,6,8,10,12,14,16,18,20,22,24];
var myNum:Number = random(framesArr.length);
var desiredFrame = framesArr[myNum];

function onEnterFrame(){
if(_framesloaded >= desiredFrame+1){
delete onEnterFrame;
gotoAndPlay(desiredFrame);
}
}

I have this scrip in my first keyframe.

With this script, the movie loads randomly at one of the key frames in my array on each refresh. So far so good, but how do I make it so that after the movie finishes, it loops back to the beginning of my movie (not to the random key frame) and keeps playing?

IronChef on
Sign In or Register to comment.