4 Replies Latest reply on May 11, 2007 9:12 AM by BLXWebMaster

    Basic menubar

    spacehog Level 1
      I am quite new to Flex and I have been unable to wrap myself around the menubars. I am looking at the basic design in the developer's guide and the structure seems straight forward. My question is how do I get the state to change when one of the menuitems is clicked?

      <mx:MenuBar id="myMenuBar" labelField="@label">
      <menuitem label="MenuItem A" >
      <menuitem label="SubMenuItem A-1" enabled="False"/>
      <menuitem label="SubMenuItem A-2"/>
      <menuitem label="MenuItem B" type="check" selected="true"/>
      <menuitem label="MenuItem C" type="check" selected="false"/>
      <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"/>

      So in the above example if the user clicked on submenu a-1 how would I change the state to statea1? I tried adding an onclick event and that didn't seem to work.