# Custom event problem

**URL:** <https://forum.kirupa.com/t/custom-event-problem/257192>\
**Category:** Uncategorized\
**Created:** [April 11, 2008, 1:39am UTC](https://forum.kirupa.com/t/custom-event-problem/257192 "2008-04-11T01:39:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThePuzzleMaster](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/thepuzzlemaster/32/972_2.png) [@ThePuzzleMaster](https://forum.kirupa.com/u/ThePuzzleMaster)\
**Post date:** [April 11, 2008, 1:39am UTC](https://forum.kirupa.com/t/custom-event-problem/257192/1 "2008-04-11T01:39:28Z")

</div>

So I have a group of MenuItems (Extends sprite) that are dynamically created from the coding in my as frame in my timeline.

```auto

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:

```auto

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!
