Shaun
Shaun

Reputation: 2191

How to disable main window when pop up window is active in AS3 AIR?

I have a "Preferences" window that opens when the user clicks on Preferences in the desktop app's Edit menu.

It works fine, apart from that if the user clicks on Preferences in the edit menu while the Preferences window is open, another Preferences window is created.

I notice that most desktop apps disable the main window when a pop up window is opened. Is this possible in AS3, and if so how do I do this please?

Upvotes: 0

Views: 72

Answers (1)

Joe Taras
Joe Taras

Reputation: 15399

When you create a pop up windows, you must set the modal flag to true so you can operate only on your windows and not in the below main window.

This is the snippet:

var popup:MyModalWindow =
        MyModalWindow(
            PopUpManager.createPopUp(
                UIComponent(this.parentApplication), MyModalWindow, true,
                PopUpManagerChildList.POPUP)
        );

In the createPopUp method the third parameter is modal (set to true)

Upvotes: 1

Related Questions