1 Reply Latest reply on Sep 11, 2009 8:24 AM by babo_ya

    Menubar root

    markuspedro Level 1

      May I set a property to see only menubar root and not the submenu?


      thank you

        • 1. Re: Menubar root
          babo_ya Level 3

          Don't really understand your question..


          if you don't want to see the submenus maybe just don't add them... but, if you want to hide/show submenus...


          try this..


          <?xml version="1.0" encoding="utf-8"?>

          <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"











              private function init():void





              private function showBtn(event:MouseEvent):void


              myMenuBar.dataProvider = d;


              private function hideBtn(event:MouseEvent):void


              myMenuBar.dataProvider = null;






          <mx:XMLList id="d">

                      <menuitem label="MenuItem A">

                          <menuitem label="SubMenuItem A-1" enabled="false"/>

                          <menuitem label="SubMenuItem A-2"/>


                      <menuitem label="MenuItem B"/>

                      <menuitem label="MenuItem C"/>

                      <menuitem label="MenuItem D">

                          <menuitem label="SubMenuItem D-1"

                              type="radio" groupName="one"/>

                          <menuitem label="SubMenuItem D-2"

                              type="radio" groupName="one"


                          <menuitem label="SubMenuItem D-3"

                              type="radio" groupName="one"/>




          <mx:Button label="show" click="showBtn(event);" />

          <mx:Button label="hide" click="hideBtn(event);" />



          <mx:MenuBar id="myMenuBar" labelField="@label">







          Maybe there is a better way to do this...


          hope this helps,