The MXML: <mx:MenuBar id="myMenuBar" labelField="@label" click="clickHandler(event)" itemClick="itemClickHandler(event)">
-TH --- In flexcoders@yahoogroups.com, "Tim Hoff" <[EMAIL PROTECTED]> wrote: > > > Interesting how related questions seem to come up on the same day. The > MenuBar items (top level) respond to the click event. The menu items > (children) respond to the itemClick event: > > import mx.events.MenuEvent; > import flash.events.MouseEvent; > import mx.controls.Alert; > > > > private function clickHandler(event:MouseEvent) : void > { > Alert.show("selected index: " + myMenuBar.selectedIndex.toString()); > } > > > > private function itemClickHandler(event:MenuEvent) : void > { > Alert.show("selected index: " + myMenuBar.selectedIndex.toString() + > " child index: " + event.index.toString()); > } > > -TH > > --- In flexcoders@yahoogroups.com, "Andres Serral" aserral@ wrote: > > > > Hello people > > I have a problem... someone maybe can help me > > The MenuBar control doesn't dispatch the "itemClick" event on items > that has > > childrens. > > Anybody knows how can I capture the click event on any item (with > childrens > > or without them)? > > > > Thanks > > > > Andres > > >