# Movie Clip buttons

**URL:** <https://forum.kirupa.com/t/movie-clip-buttons/34796>\
**Category:** flash\
**Created:** [November 6, 2003, 2:53pm UTC](https://forum.kirupa.com/t/movie-clip-buttons/34796 "2003-11-06T14:53:34Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dog\_E](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/dog_e/32/360_2.png) [@Dog\_E](https://forum.kirupa.com/u/Dog_E)\
**Post date:** [November 6, 2003, 2:53pm UTC](https://forum.kirupa.com/t/movie-clip-buttons/34796/1 "2003-11-06T14:53:34Z")

</div>

I did a movie clip, when mouseover and when mousedown thing. And i put it onto main stage. It didn’t work. So i converted that movie clip to a button so it became a movie clip in a button. When i go on, it plays, when i press, it plays, but it doesnt go to second frame when i press it. How can i?

---

<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:** [November 6, 2003, 4:40pm UTC](https://forum.kirupa.com/t/movie-clip-buttons/34796/2 "2003-11-06T16:40:31Z")

</div>

I would start again, you seem to be in a big mess here.

To make a movieclip as a button:

1. Make a graphic for the button, and convert it into a movieclip

2. go into the movieclip and put a stop() action on the first frame

3. still in this clip make a second keyframe and put a stop() on this too. Now edit this graphic for the ‘roll over’ state you want

4. Go back to the main stage and select the button clip, and put this code on it:

```auto

on (rollOver) {
   gotoAndPlay(2);
}
on (rollOut) {
    gotoAndPlay(1);
}
on (press) {
  //enter what you want the button to do when it is
 //pressed in here
}

```

That should work, ok  
🙂

---

<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:** [November 6, 2003, 7:10pm UTC](https://forum.kirupa.com/t/movie-clip-buttons/34796/3 "2003-11-06T19:10:31Z")

</div>

it doesnt work  
can you do and send me a simple fla?

---

<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:** [November 7, 2003, 9:26am UTC](https://forum.kirupa.com/t/movie-clip-buttons/34796/4 "2003-11-07T09:26:17Z")

</div>

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:** [November 7, 2003, 9:30am UTC](https://forum.kirupa.com/t/movie-clip-buttons/34796/5 "2003-11-07T09:30:26Z")

</div>

Post what you have so far so we can see what you’ve done wrong.

---

<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:** [November 7, 2003, 2:08pm UTC](https://forum.kirupa.com/t/movie-clip-buttons/34796/6 "2003-11-07T14:08:05Z")

</div>

Sorry I can’t do it I haven’t got flash on this PC.

But what isn’t happening? Is the rollover animation working?

---

<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:** [November 7, 2003, 3:08pm UTC](https://forum.kirupa.com/t/movie-clip-buttons/34796/7 "2003-11-07T15:08:55Z")

</div>

post your fla file

TD

---

<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:** [November 7, 2003, 3:09pm UTC](https://forum.kirupa.com/t/movie-clip-buttons/34796/8 "2003-11-07T15:09:34Z")

</div>

ok  
First i created a movie clip. On the first frame of movie clip, i put stop, drew a square, black, on the second frame, i colored that black square to the red. On the first frame, i converted square to the movie clip, put

on (rollOver) {  
gotoAndStop(2);  
}

,on the next frame, i converted red square to a movie clip and put

on (rollOut) {  
gotoAndStop(1);  
}

then i went on to main stage. I put the first frame stop, i put the movie clip to the stage, and in the actions, i put

on (release) {  
gotoAndStop(2);  
}

i screwed sth to the second frame.  
All i want is when the mouse is over the black square, it must turn red, and if i press it, it must go to second frame of the main stage.

---

<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:** [November 7, 2003, 3:17pm UTC](https://forum.kirupa.com/t/movie-clip-buttons/34796/9 "2003-11-07T15:17:50Z")

</div>

here it is, i did what i told you in the last message

---

<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:** [November 7, 2003, 3:46pm UTC](https://forum.kirupa.com/t/movie-clip-buttons/34796/10 "2003-11-07T15:46:21Z")

</div>

see if this is what you want:

---

<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:** [November 7, 2003, 3:54pm UTC](https://forum.kirupa.com/t/movie-clip-buttons/34796/11 "2003-11-07T15:54:11Z")

</div>

Ok, you missed the stop() that you need to have on frame 2 INSIDE the button.

Also any rollover, rollout, press, release, etc. events go ON the movieclip instance, NOT inside the movieclip itself.

So now it works, if you wanted to animate this, just change the gotoandstop to gotoandplay, and do whatever animation you want. making sure that the rollout goes to the correct frame of the beginning of the rollout animation.

Makes sense? 🙂

---

<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:** [November 7, 2003, 5:14pm UTC](https://forum.kirupa.com/t/movie-clip-buttons/34796/12 "2003-11-07T17:14:53Z")

</div>

hamidb4, actually what i wanted was not a button, but making movie clip a button.

beanboy, it didnt work, again, when i click the button, it doesnt go to 2nd frame.

---

<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:** [November 7, 2003, 7:16pm UTC](https://forum.kirupa.com/t/movie-clip-buttons/34796/13 "2003-11-07T19:16:24Z")

</div>

actions for black box movie clip:  
frame 1 of movie clip: stop();  
frame 2 of movie clip: stop();

actions to put on the clip on the main stage:  
on (rollOver) {  
gotoAndStop(2);  
}  
on (rollOut) {  
gotoAndStop(1);  
}  
on (release) {  
\_parent.gotoAndStop(2);  
}

That’s it. When you roll onto the movie clip it shows frame 2 [red square], when you roll off it shows frame 1 [black square] and when you click it it goes to frame 2 of the scene.

---

<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:** [November 7, 2003, 8:10pm UTC](https://forum.kirupa.com/t/movie-clip-buttons/34796/14 "2003-11-07T20:10:21Z")

</div>

Yeeha, thanks very much
