# Redirecting a movieclip (Flash MX)

**URL:** https://forum.kirupa.com/t/redirecting-a-movieclip-flash-mx/21057
**Category:** Uncategorized
**Created:** [May 16, 2003, 1:24pm UTC](https://forum.kirupa.com/t/redirecting-a-movieclip-flash-mx/21057 "2003-05-16T13:24:04Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![kaykills](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kaykills/32/228_2.png) [@kaykills](https://forum.kirupa.com/u/kaykills)
#### Post date: [May 16, 2003, 1:24pm UTC](https://forum.kirupa.com/t/redirecting-a-movieclip-flash-mx/21057/1 "2003-05-16T13:24:04Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 16, 2003, 4:58pm UTC](https://forum.kirupa.com/t/redirecting-a-movieclip-flash-mx/21057/2 "2003-05-16T16:58:35Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 16, 2003, 5:00pm UTC](https://forum.kirupa.com/t/redirecting-a-movieclip-flash-mx/21057/3 "2003-05-16T17:00:05Z")

</div>

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

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

```

Then on the last frame of your clip, simply put

```auto
this.gotoAndPlay(_root.frameToPlay);

```

pom 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 16, 2003, 5:02pm UTC](https://forum.kirupa.com/t/redirecting-a-movieclip-flash-mx/21057/4 "2003-05-16T17:02:36Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 16, 2003, 5:04pm UTC](https://forum.kirupa.com/t/redirecting-a-movieclip-flash-mx/21057/5 "2003-05-16T17:04:14Z")

</div>

Of course you can 🙂

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 16, 2003, 6:09pm UTC](https://forum.kirupa.com/t/redirecting-a-movieclip-flash-mx/21057/6 "2003-05-16T18:09:24Z")

</div>

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