3 Replies Latest reply on May 2, 2008 1:53 PM by dragonmagik

    How get root item in menu bar

    danielvlopes Level 1
      i have a MenuBar that have one root with no childs.
      how do i detect a click on the root?
      it seems that the itemClick only catch clicks on the menu itself, it
      doesn't catch the clicks on the root.
        • 1. Re: How get root item in menu bar
          batmitra Level 1
          hi
          i have exactly the same problem that i'd like to solve, it seems no one here knows how to do it.

          What i've found untill know is that the menubar control has a property called menubaritems which contains an array of menubaritem objects but i don't know how to implement this menubaritem.

          • 2. Re: How get root item in menu bar
            danielvlopes Level 1
            I think in create a new component extended from menubar wich had a rootClick event and submenus showed when user rollover mouse and not click.

            But i never create a component yet, and i don't know how class i must extend to change the click and create a rootclick event.
            • 3. Re: How get root item in menu bar
              dragonmagik
              in all of my applications with a menu bar, the MenuEvent.CHANGE event fires every time you click on a menu item, be it a top level, a leaf level, or a sub category level. It works exaclty like the itemClick event, except you listen for change instead of itemClick

              i.e. <mx:MenuBar id="menu" change="handleChangeEvent(event)"/>

              this should fire with a MenuEvent and event.item should be your top level or whatever level node that was clicked on. I have noticed this behavior in flex 2 as well as currently using Flex 3