2 Replies Latest reply on Jun 3, 2010 8:44 AM by jfb00

    menu issue

    jfb00 Level 3

      Hello, I have a menu that I can reach the items that doesn't have subitems.

                <mx:MenuBar labelField="@label" iconField="@icon" itemClick="handleMenuClick(event)">

                      <mx:XMLList xmlns="">

                          <menuitem label="HOME" icon="myTopIcon"/>

       

                          <menuitem label="REPORTS">

                              <menuitem label ="Report 1" />

                              <menuitem label ="Report 2" />

       

                          </menuitem>

       

                          <menuitem label="ADMIN">

                              <menuitem label ="Manage Pages" />

                              <menuitem label ="Manage Users" />

                          </menuitem>

                          <menuitem label="ABOUT" />

                      </mx:XMLList>

                  </mx:MenuBar>

       

      In my script I do this:

                   private function handleMenuClick(evt:MenuEvent):void{
                      switch(evt.label){
                          case "HOME":
                              do something....
                              break;
                          case "Manage Users":
                               do something....
                              break;

                          case "ABOUT":
                               do something....
                               break;
                          default:
                              trace("Out of range");
                              break;
                      }
                  }

       

      I can't reach HOME and ABOUT.

      Any ideas?

      Thanks in advance.

       

      Johnny