# Parent / child movie clip buttons

**URL:** <https://forum.kirupa.com/t/parent-child-movie-clip-buttons/294848>\
**Category:** flash\
**Created:** [August 20, 2009, 8:51pm UTC](https://forum.kirupa.com/t/parent-child-movie-clip-buttons/294848 "2009-08-20T20:51:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pleen](https://avatars.discourse-cdn.com/v4/letter/p/eb9ed0/32.png) [@pleen](https://forum.kirupa.com/u/pleen)\
**Post date:** [August 20, 2009, 8:51pm UTC](https://forum.kirupa.com/t/parent-child-movie-clip-buttons/294848/1 "2009-08-20T20:51:08Z")

</div>

I am a newbie trying to get this drop-down menu to work, I’ve followed several video tutorials and have pieced this together, but the tutorials mainly describe how to set up the stage but not how to add the functionality.

I’ve got the buttons working on the main navigation bar, but cannot figure how to get the dropdown menu buttons to work.

To clarify: There is code on frame 1 on the main timeline to enact a glow filter on the button MC’s which are part of NavBar\_mc. This works fine.

The NavBar\_mc contains 7 MC buttons and this navigation script on frame 1, this works as well:

home\_mc.addEventListener(MouseEvent.CLICK, clickSection);  
spa\_mc.addEventListener(MouseEvent.CLICK, clickSection);  
packages\_mc.addEventListener(MouseEvent.CLICK, clickSection);  
salon\_mc.addEventListener(MouseEvent.CLICK, clickSection);  
contact\_mc.addEventListener(MouseEvent.CLICK, clickSection);  
hours\_mc.addEventListener(MouseEvent.CLICK,clickSe ction);  
new\_mc.addEventListener(MouseEvent.CLICK, clickSection);

function clickSection(event:MouseEvent):void {  
trace('The ‘+ event.target.name + ’ button is clicked’);  
MovieClip(parent).gotoAndStop(event.target.name);  
}

There is a drop down menu with MC buttons. They are run this way:  
This is on frame 1 of the dropDowns\_mc:

stop ();

var spaFrame\_btn:SimpleButton = new SimpleButton(spaFrame\_btn);

spaFrame\_btn.addEventListener(MouseEvent.MOUSE\_OVER, goBackF);

function goBackF (event:MouseEvent):void {  
gotoAndStop(1);  
}

This is on frame 10 of the dropDowns\_mc:  
stop ();

var salonFrame\_btn:SimpleButton = new SimpleButton(salonFrame\_btn);

salonFrame\_btn.addEventListener(MouseEvent.MOUSE\_OVER, goBackX);

function goBackX (event:MouseEvent):void {  
gotoAndStop(1);  
}

I want them to gotoAndStop at a frame on the main timeline. If they could load into a blank MC that would be ok too.  
I understand it is preferable to add the code to the main timeline, but I am very confused about the event.target.name and nested MC’s and AddChild/SetChildIndex, etc.

Do I need to add a child? Declare a MC with a var? Where should I put the code to run the dropDown menu buttons?

If anyone can set me in the right direction I would be greatly appreciative!
