Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function show(realParent:Sprite,
- displayParent:Sprite = null,
- closeHandler:Function = null,
- moduleFactory:IFlexModuleFactory = null):Dialog {
- // Get the parent ...
- // If none is set, use the top-level-application.
- 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);
- }
- // Register for close-events, making sure the pop-up is closed.
- if (closeHandler != null) {
- this.addEventListener(CloseEvent.CLOSE, closeHandler);
- }
- // 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);
- PopUpManager.centerPopUp(this);
- return this;
- }
Add Comment
Please, Sign In to add comment