# Buttons inside a Movie Clip

**URL:** https://forum.kirupa.com/t/buttons-inside-a-movie-clip/58944
**Category:** Uncategorized
**Created:** [July 27, 2004, 9:15am UTC](https://forum.kirupa.com/t/buttons-inside-a-movie-clip/58944 "2004-07-27T09:15:36Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![xyron](https://avatars.discourse-cdn.com/v4/letter/x/f17d59/32.png) [@xyron](https://forum.kirupa.com/u/xyron)
#### Post date: [July 27, 2004, 9:15am UTC](https://forum.kirupa.com/t/buttons-inside-a-movie-clip/58944/1 "2004-07-27T09:15:36Z")

</div>

Hello everyone!

I have the following problem:  
I have created a sliding menu consisting of a Movie Clip using AS for the slide effect, in which I have placed the navigational buttons. I want the menu to change the Scene (eg. from Scene 1 to Scene 2) when someone presses the button, my problem is that nothing is happening. Please find the code I used below:

**Code used for the Movie Clip:**

onClipEvent (enterFrame) {  
if (yvel == 1) {  
\_y = \_y+(445-\_y)/6;  
}  
if (yvel == 0) {  
\_y = \_y+(550-\_y)/10;  
}  
}

**Code used for the Buttons:**

on (rollOver) {  
yvel = 1;  
}  
on (rollOut) {  
yvel = 0;  
}  
on (release) {  
gotoAndPlay(“Scene 2”, 1);  
}

I hope that my explanation was clear and understandable enough for someone to help me solve this (probably minor) problem.

Thanx in advance and greetings to all you flashers out there! (-:

---

<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: [July 27, 2004, 9:45am UTC](https://forum.kirupa.com/t/buttons-inside-a-movie-clip/58944/2 "2004-07-27T09:45:41Z")

</div>

I think the mistake lies in the gotoAndPlay Statement:

it’s better to create a frame label e.g. name the first frame of scene2 “myScene”

and then add this code to your button:

```auto
 on(release){
 _root.gotoAndPlay("myScene");
} 

```

---

<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: [July 27, 2004, 7:10pm UTC](https://forum.kirupa.com/t/buttons-inside-a-movie-clip/58944/3 "2004-07-27T19:10:26Z")

</div>

Thank you for your help! :thumb:

Your suggestion worked just fine!

Thx again, Mike.

> [@Flink](#):
>
> I think the mistake lies in the gotoAndPlay Statement:
> 
> it’s better to create a frame label e.g. name the first frame of scene2 “myScene”
> 
> and then add this code to your button:
> 
> ```auto
> on(release){
> _root.gotoAndPlay("myScene");
> } 
> 
> ```

---

<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: [July 28, 2004, 2:23am UTC](https://forum.kirupa.com/t/buttons-inside-a-movie-clip/58944/4 "2004-07-28T02:23:39Z")

</div>

i have a similar problem. is it possible to click a movie symbol and have it jump to another movie? it should!

i have a fish (named “dunce”) on the stage that floats around. in fact, it floats around according to the random movement code provided by this site. now… when the user clicks the fish, i want the fish to exploded (:skull: :)). i have a movie named “splat”, and it’s first frame is labeled “thesplat”. whats wrong with my coding here:  
onClipEvent(enterFrame){  
move();  
}  
onClipEvent (mouseDown) {  
\_root.gotoAndPlay(thesplat)  
}

thanks in advance

---

<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: [July 28, 2004, 2:35am UTC](https://forum.kirupa.com/t/buttons-inside-a-movie-clip/58944/5 "2004-07-28T02:35:04Z")

</div>

Flash is looking for a frame called “thesplat” on the \_root level (main timeline). You need to target the movieclip that contains the frame label.

```auto

onClipEvent(enterFrame){
move();
}
onClipEvent (mouseDown) {
_root.splat.gotoAndPlay(thesplat)
}

```

Untested but should work.

:hr:

---

<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: [July 29, 2004, 1:32am UTC](https://forum.kirupa.com/t/buttons-inside-a-movie-clip/58944/6 "2004-07-29T01:32:08Z")

</div>

nope :(… same thing. no exploding fish. nothing comes up in the output box either, it’s weird. i attached the fla, it’s pretty messed up though, i don’t even know how to delete those extra symbols. flash is currently my largest area of n00bness.

---

<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: [July 29, 2004, 6:22am UTC](https://forum.kirupa.com/t/buttons-inside-a-movie-clip/58944/7 "2004-07-29T06:22:34Z")

</div>

Your mc “splat” wasn’t on stage;)  
I’ve putted it in your “dunce” mc [size=1](with a stop() on the first frame of “splat” and the instancename “splat”)[/size]  
then with this code

```auto
onClipEvent(enterFrame){
	move();
}
onClipEvent (mouseDown) {
	splat.gotoAndPlay("thesplat")
}

```

your fish explodes=)

scotty(-:

---

<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: [July 29, 2004, 10:02am UTC](https://forum.kirupa.com/t/buttons-inside-a-movie-clip/58944/8 "2004-07-29T10:02:31Z")

</div>

omg i love you! thank you thank you thank you. this forum is teh pawsorz!!!11

---

<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: [July 29, 2004, 10:12am UTC](https://forum.kirupa.com/t/buttons-inside-a-movie-clip/58944/9 "2004-07-29T10:12:55Z")

</div>

ok… i didn’t think about this. you don’t actually have to click the fish for it to blow up. you can click anywhere and it goes splat, which is rather pointless. there’s gotta be a way so when people just click the fish that’s floatin round, then it goes splat.

anyone?

---

<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: [July 29, 2004, 2:28pm UTC](https://forum.kirupa.com/t/buttons-inside-a-movie-clip/58944/10 "2004-07-29T14:28:58Z")

</div>

Just change where the function gets called from a mousedown clip event to an onPress of the clip itself. The function used to be on the movie clip itself and now it is on the maintimeline.

---

<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: [July 30, 2004, 2:58am UTC](https://forum.kirupa.com/t/buttons-inside-a-movie-clip/58944/11 "2004-07-30T02:58:19Z")

</div>

“I see” said the blind man pissing into the wind, “it’s all comming back to me!”.

sank ya barry moots. this isn’t really about the subect of this thread anymore, but how can i make the cursor into a little cross hair over the fish? i’ll go have a gander at the tutorials…

---

<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: [July 30, 2004, 7:04am UTC](https://forum.kirupa.com/t/buttons-inside-a-movie-clip/58944/12 "2004-07-30T07:04:06Z")

</div>

[http://www.kirupa.com/developer/flash5/globalmousecursor.htm](http://www.kirupa.com/developer/flash5/globalmousecursor.htm)  
[http://www.kirupa.com/developer/flash5/follow.htm](http://www.kirupa.com/developer/flash5/follow.htm)  
will give you an idea:)

scotty(-:
