Add an event listener to the menubar itself. In the event listener you can find
out which item was clicked based on the label property.
--- In flexcoders@yahoogroups.com, Gustavo Duenas gduenas@... wrote:
Hi I have this menu bar.
mx:MenuBar width=1079.697 height=40.151516 id=mBar
labelField=@label creationComplete=init() fontSize=14
fillAlphas=[0.26, 0.26, 0.26, 0.26] fontWeight=bold
cornerRadius=6 color=#071243 fontFamily=Arial
verticalCenter=-4 left=9.05
mx:dataProvider
mx:XMLListCollection
mx:XMLList xmlns=
item label=Peticin de Oracin/
item label=Peticin de Visita/
item label=Contctenos/
item label=Publicaciones
item label=La Biblia Antiguo Testamento groupName=libros/
item label=La Biblia Nuevo Testamento groupName=libros/
item label=Concordancia Temtica de la Biblia groupName=libros/
item label=Doctrina Cristiana groupName=libros/
/item
item label=Iglesia FLS Blog/
item label=Donaciones/
/mx:XMLList
/mx:XMLListCollection
/mx:dataProvider
I wan to access the group name libros items to add evenListeners to
them.
I have this code to access the main ones on the menuBar.
protected function init():void{
var mbiBlog:MenuBarItem= mBar.menuBarItems[4] as MenuBarItem;
mbiBlog.addEventListener(MouseEvent.CLICK, openWindowBlog);
var mbiAntiguoT:MenuBarItem = mBar.menuBarItems[3].root[1] as
MenuBarItem;// I've been trying to access the sub-Items I really don't
know how, some help please.
mbiAntiguoT.addEventListener(MouseEvent.CLICK, windowBibliaAntigua);
}