# Button menu problem

**URL:** <https://forum.kirupa.com/t/button-menu-problem/276964>\
**Category:** Uncategorized\
**Created:** [December 5, 2008, 6:13pm UTC](https://forum.kirupa.com/t/button-menu-problem/276964 "2008-12-05T18:13:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ParanoidAndroid](https://avatars.discourse-cdn.com/v4/letter/p/b19c9b/32.png) [@ParanoidAndroid](https://forum.kirupa.com/u/ParanoidAndroid)\
**Post date:** [December 5, 2008, 6:13pm UTC](https://forum.kirupa.com/t/button-menu-problem/276964/1 "2008-12-05T18:13:22Z")

</div>

hi  
i’m trying to make a button menu in AS3. i have several clip-buttons on stage, with instance names.in main timeline i have a activeButton variable that keeps track the name of the selected button.  
Inside the clip i wrote the listeners and the functions for the up, over, down states.the problem is with the down function, that triggers when i click the button. the first line is the problem:

function down(e:MouseEvent):void  
{  
[COLOR=red]MovieClip(this.parent.getChildByName(activeButton)).gotoAndStop(“up”[/COLOR]);  
btnLabel.textColor=0xFF0000;  
MovieClip(parent).activeButton=this.name;  
this.gotoAndStop(“down”);  
}  
i get an error “activeButton is not a property” or something like that. However, if i put the function in the main timeline, there’s no problem:MovieClip(this.getChildByName(activeButton)).gotoAndStop(“up”)  
it works great. why the code inside the function doesn’t work? i’m even casting the information. what’s the problem??  
anyone can help, please?
