# Button functionality with nested MC's

**URL:** <https://forum.kirupa.com/t/button-functionality-with-nested-mcs/294370>\
**Category:** Uncategorized\
**Created:** [August 13, 2009, 6:32am UTC](https://forum.kirupa.com/t/button-functionality-with-nested-mcs/294370 "2009-08-13T06:32:45Z")\
**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 13, 2009, 6:32am UTC](https://forum.kirupa.com/t/button-functionality-with-nested-mcs/294370/1 "2009-08-13T06:32:45Z")

</div>

Hello,  
I am trying to get this drop-down menu to work, I’ve followed several video tutorials and have pieced this together, but I am FAR from REALLY knowing what I am doing…

The trace function shows the NavBar\_mc is working, but I don’t understand how to get the eventListener to goToAnd Play a frame label on the main timeline. Similar problem with the drop down menu.

To clarify: The AS that controls the glowFilter on the main buttons is on the main timeline (the GlowFilter part works, but not the navigation):

stop ();  
var navBtnGlow:GlowFilter = new GlowFilter(0xffffcd, 0.5, 0, 10, 2, 1, true, false);  
navBar\_mc.addEventListener(MouseEvent.MOUSE\_OVER, navOverF);  
navBar\_mc.addEventListener(MouseEvent.MOUSE\_OUT, navOutF);  
function navOverF(event:MouseEvent):void {  
event.target.filters = [navBtnGlow];  
navBar\_mc.setChildIndex(event.target as DisplayObject, 1);  
dropMenus\_mc.gotoAndStop(navBar\_mc.getChildAt(1).name);  
trace ('we are rolling over ’ + navBar\_mc.getChildAt(1).name)  
}  
function navOutF(event:MouseEvent):void {  
event.target.filters = [];  
}

The NavBar\_mc contains 7 MC buttons and this script on frame 1:

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,clickSection);  
new\_mc.addEventListener(MouseEvent.CLICK, clickSection);

function clickSection(event:MouseEvent):void {

//this works  
trace('The ‘+ event.target.name + ’ button is clicked’);  
//this doesn’t work  
gotoAndStop(event.target.name);

I am very confused about the event.target.name and nested MC’s and AddChild/SetChildIndex, etc.  
If anyone can set me in the right direction I would be greatly appreciative!
