# Problem with a button inside of a movie clip!

**URL:** <https://forum.kirupa.com/t/problem-with-a-button-inside-of-a-movie-clip/285295>\
**Category:** flash\
**Created:** [March 30, 2009, 8:01am UTC](https://forum.kirupa.com/t/problem-with-a-button-inside-of-a-movie-clip/285295 "2009-03-30T08:01:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ballerz4life](https://avatars.discourse-cdn.com/v4/letter/b/e19b73/32.png) [@ballerz4life](https://forum.kirupa.com/u/ballerz4life)\
**Post date:** [March 30, 2009, 8:01am UTC](https://forum.kirupa.com/t/problem-with-a-button-inside-of-a-movie-clip/285295/1 "2009-03-30T08:01:57Z")

</div>

I believe post should be in this sections since I am having problems with writing the script.  
Forgive me if it is in the wrong section.

I am using Flash CS4. I am trying to get 4 buttons to work that are inside of a movie clip. I have read many suggestions but I am still not getting it to work.

Here are some of the things I have tried…

example1\_btn.addEventListener(MouseEvent.CLICK, onExmp1Click);  
example2\_btn.addEventListener(MouseEvent.CLICK, onExmp2Click);  
example3\_btn.addEventListener(MouseEvent.CLICK, onExmp3Click);  
example4\_btn.addEventListener(MouseEvent.CLICK, onExmp4Click);

function onExmp1Click(e:MouseEvent):void

{  
gotoAndStop(“1”)  
}

function onExmp2Click(e:MouseEvent):void

{  
gotoAndStop(“2”)  
}

function onExmp3Click(e:MouseEvent):void

{  
gotoAndStop(“3”)  
}

function onExmp4Click(e:MouseEvent):void

{  
gotoAndStop(“4”)  
}

This is what is working for the buttons that are on the main timeline. I tried this inside of the movie clip on the actions layer without any luck.

Some said I could apply this directly to the button but I am not sure how to do that…

on (release)

{  
\_root.gotoAndStop(“2”);  
}

I have tried this on the main timeline as well…

container\_mc.btn.onRelease = function()

{  
\_root.gotoAndPlay(”framelabel”);  
};

I have been working on this for about six straight hours and I really need to get this figured out. I would be more than happy to upload what I have if anyone would like to take a look at it. Just let me know what files you would need.

I would greatly appreciate any help with this.

Thank you…
