0 Replies Latest reply on Dec 10, 2010 9:33 AM by giba_f

    Problem in click in the MenuBar out site opction.

    giba_f Level 1

      Hello everyone!

      I have a MenuBar with width = "100%" to occupy the whole line, but when I click a part of the menu item that has not, is giving an error message.

      How to solve this?

      below, down the block from my code:

       

       

       

       

      <mx:Canvas id="PlaceMenu" width="100%" height="35" left="0" top="108" >
          <mx:MenuBar id="menuBar" labelField="@label" width="100%" height="100%"
              dataProvider="{OpcMnuBar}" click="ExecOpcMnu(event);"  itemClick="ExecOpcItemMnu(event);"   y="8" >
          </mx:MenuBar>
      </mx:Canvas>


      private function ExecOpcMnu(event:MouseEvent):void  {
          if ( MenuBarItem(event.target).data.@data == "Mnu1") {}
          else if ( MenuBarItem(event.target).data.@data == "Mnu2") {}
          else if ( MenuBarItem(event.target).data.@data == "Mnu3") {}
          else if ( MenuBarItem(event.target).data.@data == "Mnu4") {}
          else if ( MenuBarItem(event.target).data.@data == "Mnu5") {}
      }

      Thanks

       

      Gilberto