# getChildAt() issue

**URL:** https://forum.kirupa.com/t/getchildat-issue/289131
**Category:** flash
**Created:** [May 26, 2009, 7:05pm UTC](https://forum.kirupa.com/t/getchildat-issue/289131 "2009-05-26T19:05:25Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Dimitree](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/dimitree/32/2530_2.png) [@Dimitree](https://forum.kirupa.com/u/Dimitree)
#### Post date: [May 26, 2009, 7:05pm UTC](https://forum.kirupa.com/t/getchildat-issue/289131/1 "2009-05-26T19:05:25Z")

</div>

I have an XML menu. The text is nested inside a movieclip in order to activate the hand cursor. Each menu element has two listeners that activate the following functions

When I use the following code I get all the menu elements formated (the proper way is only the one choosen - should be formated!)

```auto
function buttonModeTrue(event: Event):void {
	trace(event.target);	
	for (var i:uint=0; i < MC_text.numChildren; i++)
    {	
	event.target.getChildAt(i).setTextFormat(textFormatMainUp);}
	var on_sound:Sound = new onsound();
	on_sound.play();
}
function buttonModeFalse(event: Event):void {
	trace(event.target);
	for (var i:uint=0; i < MC_text.numChildren; i++)
    {
	event.target.getChildAt(i).setTextFormat(textFormatMainUp);
	
	}
	trace("onmouseout");
}

```

I get no error in the output panel- but it doesnt work the way I want to  
Probably is something simple for someone that is used to “loop thing”…

- Also the sound is not functioning
