Skip to main content
Participant
March 20, 2013
Answered

How to prevent the opening of pop-up submenu of mx:MenuBar during its mouseOver/rollOver events ?

  • March 20, 2013
  • 1 reply
  • 3021 views

Im using a mx:MenuBar component with xml data to bring a menu. The basic behaviour as I see is, initially on clicking the top level menu item (i.e on the horizontal bar), the pop-up sub menu opens. Then without clicking anywhere, if I mouse over / roll over on the horizontal menu bar, the pop-up sub menus of the other top level menus opens up.

This behaviour seems to be inconsistent. The pop-up sub menus should open either on click of any top level menu item (horizontal menu bar) or only on mouse over / roll over of the menu bar items.

I want the pop-up submenus to open only on click of the top level menu (horizontal menu bar). So I added event handlers for mouseOver as well as rollOver events (don't know which event actually gets generated on hovering over the horizontal menu bar). In the event handlers, I called the event.preventDefault() method to prevent the default behaviour(i.e opening of pop-up sub menus).  But, nothing works. I felt like, I don't have control over it.

how to suppress the default behaviour and open the pop-up submenus only on click event of the menu bar?

Menu Bar with no user action :

Menu Bar after clicking the menu 'Flex' :

Menu Bar after clicking the menu 'Flex' and hovering over the other top level menus in the horizontal bar :


This topic has been closed for replies.
Correct answer Santo87

All,

Go through the below mentioned link to find the answer.

http://stackoverflow.com/questions/15532911/how-to-prevent-the-opening-of-pop-up-submenu-of-mxmenubar-flex-during-its-mou

This solution works perfectly as what I expected.

1 reply

Santo87AuthorCorrect answer
Participant
April 17, 2013

All,

Go through the below mentioned link to find the answer.

http://stackoverflow.com/questions/15532911/how-to-prevent-the-opening-of-pop-up-submenu-of-mxmenubar-flex-during-its-mou

This solution works perfectly as what I expected.