Try casting FlexGlobals.topLevelApplication to UIComponent, or a container
class, not Sprite. By casting to Sprite you're stripping out all the Flex
framework classes and associated event model, which could be what is causing
your errors.

_______________________________________________________________________

Joseph Balderson, Flex & Flash Platform Developer :: http://joeflash.ca
Author, Professional Flex 3 :: http://tinyurl.com/proflex3book

Christofer Dutz wrote:
> So this was due to a bug? ... well it shouldn't harm cleaning up my global 
> Popup-Opening-Code ;-)
> Will give Flex 4.12 a try as soon as I have the last issues of the 
> application I'm currently working on resolved 
> (Really bad that one of the Problems would have been solved by updating ... 
> well ... whatever ;-) ) 
> 
> Chris
> ________________________________________
> Von: Maurice Amsellem <[email protected]>
> Gesendet: Donnerstag, 27. Februar 2014 00:30
> An: [email protected]
> Betreff: RE: AW: Strange hanging when handling Popup
> 
> Had the same lock-up and was fixed in 4.12.
> 
> -----Message d'origine-----
> De : Alex Harui [mailto:[email protected]]
> Envoyé : mercredi 26 février 2014 22:53
> À : [email protected]
> Objet : Re: AW: Strange hanging when handling Popup
> 
> Can you try the 4.12 release candidate?  There was a bug in that 
> findHighestModalForm that I fixed for 4.12.
> 
> -Alex
> 
> On 2/26/14 1:08 PM, "Christofer Dutz" <[email protected]> wrote:
> 
>> Ok ... so I sumbled over one PopupDialog in my application that didn't
>> lock up and I had a look at the differences:
>>
>> Locking Up version is opened with this code:
>>        // If the parent was not specified, use the root as parent.
>>        if (!parent) {
>>            var sm:ISystemManager =
>> ISystemManager(FlexGlobals.topLevelApplication.systemManager);
>>            // no types so no dependencies
>>            var mp:Object =
>> sm.getImplementation("mx.managers.IMarshallPlanSystemManager");
>>            if (mp && mp.useSWFBridge()) {
>>                parent = Sprite(sm.getSandboxRoot());
>>            } else {
>>                parent = Sprite(FlexGlobals.topLevelApplication);
>>            }
>>        }
>>
>>        // Open an center the popup.
>>        PopUpManager.addPopUp(dialog, parent, true);
>>        PopUpManager.centerPopUp(dialog);
>>
>>
>> The non-locking version however uses this:
>>
>>        if (!displayParent) {
>>            var sm:ISystemManager =
>> ISystemManager(FlexGlobals.topLevelApplication.systemManager);
>>            // no types so no dependencies
>>            var mp:Object =
>> sm.getImplementation("mx.managers.IMarshallPlanSystemManager");
>>            if (mp && mp.useSWFBridge())
>>                displayParent = Sprite(sm.getSandboxRoot());
>>            else
>>                displayParent = Sprite(FlexGlobals.topLevelApplication);
>>        }
>>
>>        // Setting a module factory allows the correct embedded font to
>> be found.
>>        if (moduleFactory) {
>>            this.moduleFactory = moduleFactory;
>>        } else if (realParent is IFlexModule) {
>>            this.moduleFactory = IFlexModule(realParent).moduleFactory;
>>        } else {
>>            if (realParent is IFlexModuleFactory) {
>>                this.moduleFactory = IFlexModuleFactory(realParent);
>>            } else {
>>                this.moduleFactory =
>> FlexGlobals.topLevelApplication.moduleFactory;
>>            }
>>
>>            // also set document if parent isn't a UIComponent
>>            if (!(parent is UIComponent)) {
>>                this.document = FlexGlobals.topLevelApplication.document;
>>            }
>>        }
>>
>>        // Make the dialog center itself relative to the parent.
>>        PopUpManager.addPopUp(this, displayParent, true, null,
>> this.moduleFactory);
>>        PopUpManager.centerPopUp(this);
>>
>>
>> (Really wonder where I got that construct from ) So it seems the
>> moduleFactory setting seems to be preventing the lockup.
>> The strange thing is that in my application I no longer have modules
>> and I recall most moduleFactory issues were related to my
>> module-loading.
>>
>> Anyway ... just thought I have that code indexed so mabe someone might
>> find it usefull.
>>
>> Chris
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Christofer Dutz [mailto:[email protected]]
>> Gesendet: Mittwoch, 26. Februar 2014 21:11
>> An: [email protected]
>> Betreff: Strange hanging when handling Popup
>>
>> Hi,
>>
>> I just encountered a problem in one of my applications. I am using Flex
>> 4.11.0.20131017
>>
>> The popup opens, but when I click anywhere inside the popup, the
>> application locks up causing a timeout error after a few seconds.
>>
>> This is what's logged to the console:
>>
>> [Fault] exception, information=Error: Error #1502: A script has
>> executed for longer than the default timeout period of 15 seconds.
>> at
>> mx.managers.systemClasses::ActiveWindowManager/findHighestModalForm()[/
>> Use
>> rs/justinmclean/Documents/ApacheFlex4.11.0/frameworks/projects/framewor
>> k/s rc/mx/managers/systemClasses/ActiveWindowManager.as:436]
>> at
>> mx.managers.systemClasses::ActiveWindowManager/mouseDownHandler()[/User
>> s/j
>> ustinmclean/Documents/ApacheFlex4.11.0/frameworks/projects/framework/sr
>> c/m x/managers/systemClasses/ActiveWindowManager.as:469]
>> at flash.events::EventDispatcher/dispatchEventFunction()
>> at flash.events::EventDispatcher/dispatchEvent()
>> at
>> mx.managers::SystemManager/mouseEventHandler()[/Users/justinmclean/Docu
>> men
>> ts/ApacheFlex4.11.0/frameworks/projects/framework/src/mx/managers/Syste
>> mMa
>> nager.as:2926]
>>
>> What could be causing this?
>>
>> Chris
> 
> 

Reply via email to