Redirecting a movieclip (Flash MX)

hopefully someone can help. i am relatively new to actionscript. I have a movieClip that plays up to frame 20 and then stops. I have buttons on the main timeline that when clicked will gotoAndPlay the movieClip. There will be at least 18 buttons on the main timeline that all will gotoAndPlay the same movieClip. What I am having trouble with is after the movieClip has played and stopped on frame 20, i want to redirect the movieClip to another frame in that movieClip based on what button was originally pressed.

I might have confused everyone that has read this, but if someone understands and can help me I would greatly appreciate it.

Cheers
Michael

Ok, i might have a solution, but it gonna require quite a bit of
scriptin, and there probally a much easier way:

Create a movie clip, lest say you cal it “scripting”.

Wen a button is clicked you could make a varible go to a certain numer, depending on witch button is clicked.

Then whenframe 20 is reache, it will check to see what that varible in the movie clip “scripting” is(e.g if(scripting.frame=5){gotoAndPlay(5)}), and dothat fo every button.

Sorry if i made it hrd to understamd, i not that good of an explainer, e-mailo me if u nee more help.

On your buttons, you’ll put something like this:

on (press) {
	// do stuff
	_root.frameToPlay = 12; // for instance
}

Then on the last frame of your clip, simply put

this.gotoAndPlay(_root.frameToPlay);

pom :slight_smile:

i thought that might wor,but i wasn’t quite sure.
i didn’t know ifu could put a varible, in that type of script.

Of course you can :slight_smile:

thank you for the help… i am going to try when I get home from work… cheers… michael