Hi,
I have a MenuBar with the following data within it
ROOT
--CHILD1
----SubChild1-1
----SubChild1-2
----SubChild1-3
--CHILD2
--CHILD3
ROOT2
ROOT3
When the mouse exits any Menu I execute a "menu.hide()" and the drop down menu
disappears. When I click again on ROOT1 the menu shows again OK. I am detecting
this by an item rollout event and detecting the mouse position relative to the
menu box boundaries.
This works fine when the menu data does not contain more than one level of
children (i.e. no more than Child1, Child2 and Child3). However ONCE I
introduce a second level of children (subchild1-1 etc) the MenuBar seems to
break.
For example, when the "subchild1-1, 1-2, 1-3" menu displays, when the mouse
exits that menu I properly call "menu.parentMenu.hide()". However once I click
again on ROOT1 I get the following error below. My question is why does calling
menu.hide() when in context of a sub-menu, does the menubar break like this? Is
there some state other than menu.hide() I must reset that is not documented?
RangeError: Error #2006: The supplied index is out of bounds.
at flash.display:

isplayObjectContainer/addChildAt()
at
mx.managers::SystemManager/http://www.adobe.com/20 06/flex/mx/internal::rawChildr
en_addChildAt()[/Applications/Adobe Flex Builder 3
Plug-in/sdks/3.1.0/frameworks/projects/framework/src/mx/ managers/SystemManager.a
s:1687]
at mx.managers::SystemManager/addChild()[/Applications/Adobe Flex Builder 3
Plug-in/sdks/3.1.0/frameworks/projects/framework/src/mx/ managers/SystemManager.a
s:1225]
at mx.managers::PopUpManagerImpl/addPopUp()[/Applications/Adobe Flex Builder
3
Plug-in/sdks/3.1.0/frameworks/projects/framework/src/mx/ managers/PopUpManagerImp
l.as:263]
at mx.managers::PopUpManager$/addPopUp()[/Applications/Adobe Flex Builder 3
Plug-in/sdks/3.1.0/frameworks/projects/framework/src/mx/ managers/PopUpManager.as
:169]
at mx.controls::Menu/show()[/Applications/Adobe Flex Builder 3
Plug-in/sdks/3.1.0/frameworks/projects/framework/src/mx/ controls/Menu.as:1406]
at mx.controls::MenuBar/showMenu()[/Applications/Adobe Flex Builder 3
Plug-in/sdks/3.1.0/frameworks/projects/framework/src/mx/ controls/MenuBar.as:1664
]
at mx.controls::MenuBar/mouseOverHandler()[/Applications/Adobe Flex Builder 3
Plug-in/sdks/3.1.0/frameworks/projects/framework/src/mx/ controls/MenuBar.as:1756
]