[flexcoders] Re: problem accessing menuBar component Sub-Items

2011-10-30 Thread Gustavo Duenas
I did it, thanks.


[flexcoders] Re: problem accessing menuBar component Sub-Items

2011-10-17 Thread valdhor
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:XMLList xmlns=
item label=Petici—n de Oraci—n/
item label=Petici—n de Visita/
item label=Cont‡ctenos/
item label=Publicaciones
item label=La Biblia Antiguo Testamento groupName=libros/
item label=La Biblia Nuevo Testamento groupName=libros/
item label=Concordancia Tem‡tica de la Biblia groupName=libros/
item label=Doctrina Cristiana groupName=libros/
item label=Iglesia FLS Blog/
item label=Donaciones/
 I wan to access the group name libros items to add evenListeners to  
 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);