getChildAt() issue

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!)

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