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()[/Users/justinmclean/Documents/ApacheFlex4.11.0/frameworks/projects/framework/src/mx/managers/systemClasses/ActiveWindowManager.as:436]
at
mx.managers.systemClasses::ActiveWindowManager/mouseDownHandler()[/Users/justinmclean/Documents/ApacheFlex4.11.0/frameworks/projects/framework/src/mx/managers/systemClasses/ActiveWindowManager.as:469]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at
mx.managers::SystemManager/mouseEventHandler()[/Users/justinmclean/Documents/ApacheFlex4.11.0/frameworks/projects/framework/src/mx/managers/SystemManager.as:2926]
What could be causing this?
Chris