So I have a group of MenuItems (Extends sprite) that are dynamically created from the coding in my as frame in my timeline.
for(var i:int=0;i<menuArray;i++){
var tmp:MenuItem = new MenuItem(menuArray*);
tmp.id=i;
}
in the coding for these menuitems is a line that dispatches a custom event when one of them is selected. I would like all of the menuItems to react when one is pressed. Leaving out the extraneous stuff my coding is:
public static const MENU_SELECTED:String="MENU_SELECTED";
addEventListener(MenuItem.MENU_SELECTED, menuReset);
function menuDownListener(e:MouseEvent):void{
dispatchEvent(new Event(MenuItem.MENU_SELECTED));
}
in my menuReset function I have a trace command that displays the id variable I set up for each menu item.
trace(e.currentTarget.id);
The problem is that it only ever runs the menuReset function for the menu item that gets pressed. None of the other items react to the listener?
What am I missing here?
Thanks guys!