Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
Adobe Flex SDK 3.5 (Release)
-
None
-
Affected OS(s): All OS Platforms
Language Found: English
Description
Steps to reproduce in SDK 3.5.0.12683:
1. Open a panel with a MenuBar instance in a PopUp using PopUpManager.addPopUp(panel, this, false, PopUpManagerChildList.POPUP);
2. Actuate the menu a few times
3. Watch the explosion on your console.
Actual Results:
RangeError: Error #2006: The supplied index is out of bounds.
at flash.display::DisplayObjectContainer/addChildAt()
at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::rawChildren_addChildAt()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\managers\SystemManager.as:2179]
at mx.managers::SystemChildrenList/addChild()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\managers\SystemChildrenList.as:111]
at mx.managers::PopUpManagerImpl/addPopUp()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\managers\PopUpManagerImpl.as:309]
at mx.managers::PopUpManager$/addPopUp()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\managers\PopUpManager.as:169]
at mx.controls::MenuBar/showMenu()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\controls\MenuBar.as:1681]
at mx.controls::MenuBar/mouseDownHandler()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\controls\MenuBar.as:1898]
Expected Results:
No RTE
Workaround (if any):
There are 3 possible fixes for this bug.
1. SystemManager.as - line 1811, the contains() method is excluding children with an index below the current value of the "noTopMostIndex" property when the popupChildren IChildList's children start at this value. This prevents any interested objects from using the contains() method on the SystemManager to check for popupChildren existence (@see MenuBar.as line 1679).
2. SystemChildrenList.as - line 110 and 121, addChild() and addChildAt() methods fail to check if the DisplayObject being added is already a child of owner before incrementing the upperBoundReference. This causes subsequent calls to those methods throw a RangeError.
3. PopupManagerImpl.as - line 307 fails to check whether or not the displayObject being popped up is already a child of the IChildList instance before calling addChild().
Any of the fixes mentioned above would solve this problem but for brevity, I have attached a monkey patch for the SystemChildrenList.as with the repro project.