2 Replies Latest reply on Dec 19, 2011 3:23 AM by emiranda1

    Just upgraded to Flex 4.6, now PopUpManager.removePopUp is throwing errors

    emiranda1

      I just upgraded form Flex 4.5 to Flex 4.6, I tried to run an old project that ran perfectly in 4.5 and it gives me errors when I run it in 4.6, specifically with the PopUpManager.

       

      This is a Flex Mobile Project

       

      I get the following error....

       

      ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.

                at flash.display::DisplayObjectContainer/getChildIndex()

                at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::rawChildren_getChildIndex()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\SystemManager.as:2187]

                at mx.managers::SystemRawChildrenList/getChildIndex()[E:\dev\4.y\frameworks\projects\framewo rk\src\mx\managers\SystemRawChildrenList.as:181]

                at spark.components.supportClasses::StyleableStageText/getFormIndex()[E:\dev\4.y\frameworks\ projects\mobilecomponents\src\spark\components\supportClasses\StyleableStageText.as:1956]

                at spark.components.supportClasses::StyleableStageText/findTopmostForm()[E:\dev\4.y\framewor ks\projects\mobilecomponents\src\spark\components\supportClasses\StyleableStageText.as:193 3]

                at spark.components.supportClasses::StyleableStageText/updateProxyImageForTopmostForm()[E:\d ev\4.y\frameworks\projects\mobilecomponents\src\spark\components\supportClasses\StyleableS tageText.as:2172]

                at spark.components.supportClasses::StyleableStageText/awm_removeFocusManagerHandler()[E:\de v\4.y\frameworks\projects\mobilecomponents\src\spark\components\supportClasses\StyleableSt ageText.as:2553]

                at flash.events::EventDispatcher/dispatchEventFunction()

                at flash.events::EventDispatcher/dispatchEvent()

                at mx.managers.systemClasses::ActiveWindowManager/removeFocusManager()[E:\dev\4.y\frameworks \projects\framework\src\mx\managers\systemClasses\ActiveWindowManager.as:409]

                at mx.managers::PopUpManagerImpl/popupRemovedHandler()[E:\dev\4.y\frameworks\projects\framew ork\src\mx\managers\PopUpManagerImpl.as:1198]

                at flash.display::DisplayObjectContainer/removeChild()

                at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::rawChildren_removeChild()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\SystemManager.as:2144]

                at mx.managers::SystemManager/removeChild()[E:\dev\4.y\frameworks\projects\framework\src\mx\ managers\SystemManager.as:1787]

                at mx.managers::PopUpManagerImpl/removePopUp()[E:\dev\4.y\frameworks\projects\framework\src\ mx\managers\PopUpManagerImpl.as:633]

                at mx.managers::PopUpManager$/removePopUp()[E:\dev\4.y\frameworks\projects\framework\src\mx\ managers\PopUpManager.as:230]

                at piehammer.managers::MenuManager()[/Users/edgar/Documents/Projects/checkers/src/piehammer/ managers/MenuManager.as:42]

                at piehammer.managers::MenuManager$/getInstance()[/Users/edgar/Documents/Projects/checkers/s rc/piehammer/managers/MenuManager.as:63]

                at views::GameView/init()[/Users/edgar/Documents/Projects/checkers/src/views/GameView.mxml:3 7]

                at views::GameView/___GameView_View1_initialize()[/Users/edgar/Documents/Projects/checkers/s rc/views/GameView.mxml:7]

                at flash.events::EventDispatcher/dispatchEventFunction()

                at flash.events::EventDispatcher/dispatchEvent()

                at mx.core::UIComponent/dispatchEvent()[E:\dev\4.y\frameworks\projects\framework\src\mx\core \UIComponent.as:13152]

                at mx.core::UIComponent/set processedDescriptors()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.a s:1871]

                at mx.core::UIComponent/initializationComplete()[E:\dev\4.y\frameworks\projects\framework\sr c\mx\core\UIComponent.as:7670]

                at mx.core::UIComponent/initialize()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UI Component.as:7649]

                at spark.components::View/initialize()[E:\dev\4.y\frameworks\projects\mobilecomponents\src\s park\components\View.as:999]

                at views::GameView/initialize()

                at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::childAdded()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:7495]

                at mx.core::UIComponent/addChildAt()[E:\dev\4.y\frameworks\projects\framework\src\mx\core\UI Component.as:7199]

                at spark.components::Group/addDisplayObjectToDisplayList()[E:\dev\4.y\frameworks\projects\sp ark\src\spark\components\Group.as:2037]

                at spark.components::Group/http://www.adobe.com/2006/flex/mx/internal::elementAdded()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Group.as:1628]

                at spark.components::Group/addElementAt()[E:\dev\4.y\frameworks\projects\spark\src\spark\com ponents\Group.as:1387]

                at spark.components::Group/addElement()[E:\dev\4.y\frameworks\projects\spark\src\spark\compo nents\Group.as:1345]

                at spark.components::SkinnableContainer/addElement()[E:\dev\4.y\frameworks\projects\spark\sr c\spark\components\SkinnableContainer.as:761]

                at spark.components::ViewNavigator/createViewInstance()[E:\dev\4.y\frameworks\projects\mobil ecomponents\src\spark\components\ViewNavigator.as:2018]

                at spark.components::ViewNavigator/commitNavigatorAction()[E:\dev\4.y\frameworks\projects\mo bilecomponents\src\spark\components\ViewNavigator.as:1932]

                at spark.components::ViewNavigator/commitProperties()[E:\dev\4.y\frameworks\projects\mobilec omponents\src\spark\components\ViewNavigator.as:1301]

                at mx.core::UIComponent/validateProperties()[E:\dev\4.y\frameworks\projects\framework\src\mx \core\UIComponent.as:8219]

                at mx.managers::LayoutManager/validateProperties()[E:\dev\4.y\frameworks\projects\framework\ src\mx\managers\LayoutManager.as:597]

                at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.y\frameworks\projects\framewo rk\src\mx\managers\LayoutManager.as:783]

                at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.y\frameworks\projects \framework\src\mx\managers\LayoutManager.as:1180]

       

       

      This seems to happen when I try to initialize a couple pop ups...

       

      public function MenuManager(pParent:DisplayObject)

                          {

                                    menuParent = pParent

       

                                    newGameMenu = PopUpManager.createPopUp(menuParent, NewGameMenu, true) as NewGameMenu

                                    settingsMenu = PopUpManager.createPopUp(menuParent, SettingsMenu, true) as SettingsMenu

       

                                    newGameMenu.addEventListener(GameEvent.ONLINE_GAME_VS_RANDOM_OPPONENT, onOnlineGameStart)

                                    newGameMenu.addEventListener(GameEvent.LOCAL_GAME_VS_COMPUTER, onLocalComputerGameStart)

                                    newGameMenu.addEventListener(GameEvent.LOCAL_GAME_VS_FRIEND, onLocalFriendGameStart)

       

                                    PopUpManager.removePopUp(newGameMenu)

                                    PopUpManager.removePopUp(settingsMenu) // this is line 42

                          }

       

      If it makes any difference, the code works fine if I comment out line 42 (it's just now I have a lingering pop up upon launch).

       

      Any ideas as to what is causing this issue?