I want to find out how I would change the the text color on a menubar once one of its submenu items is selected. I know this can not be done using any of the style attributes on the menubar. I am trying to use the setStyle method. The problem I am having is that it's changing the text color of the whole menu bar and not just the one it needs to. Does any one know how accomplish this. Thanks
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"> <mx:Script> function changecolor() { var whatcolor = menubar.getStyle("color") menubar.setStyle("color","0xff0000"); alert(whatcolor) } </mx:Script> <mx:Panel id="panel" title="Menu Bar Panel" height="35%" width="30%"> <mx:MenuBar id="menubar" change="this[event.menuItem.attributes.action]()" > <mx:dataProvider> <mx:XML > <menuitem label="MenuItem A"> <menuitem label="SubMenuItem 1-A" action="changecolor" /> <menuitem label="SubMenuItem 2-A" action="changecolor" /> </menuitem> <menuitem label="MenuItem b"> <menuitem label="SubMenuItem 1-b" action="changecolor" /> <menuitem label="SubMenuItem 2-b" action="changecolor" /> </menuitem> </mx:XML> </mx:dataProvider> </mx:MenuBar> </mx:Panel> </mx:Application> ------------------------ Yahoo! Groups Sponsor --------------------~--> Fair play? Video games influencing politics. Click and talk back! http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM --------------------------------------------------------------------~-> -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/