View comments | RSS feed

PopUpManager.createPopUp()

Availability

Flash Player 6 (6.0.79.0).

Edition

Flash MX 2004 and Flash MX Professional 2004.

Usage

PopUpManager.createPopUp(parent, class, modal [, initobj, outsideEvents])

Parameters

parent A reference to a window to pop-up over.

class A reference to the class of object you want to create.

modal A Boolean value indicating whether the window is modal (true) or not (false).

initobj  An object containing initialization properties. This parameter is optional.

outsideEvents A Boolean value indicating whether an event is triggered if the user clicks outside the window (true) or not (false). This parameter is optional.

Returns

A reference to the object that was created.

If the class parameter is Window and a window component is in the library, the returned reference is a Window.

Description

Method; if modal, a call to createPopUp() finds the topmost parent window starting with parent and creates an instance of class. If nonmodal, a call to createPopUp() creates an instance of the class as a child of the parent window.

Example

The following code creates a modal window when the button is clicked:

lo = new Object();
lo.click = function(){
    mx.managers.PopUpManager.createPopUp(_root, mx.containers.Window, true);
}
button.addEventListener("click", lo);

Flash CS3


Comments


Aaron Traas said on Jul 25, 2008 at 1:42 PM :
The code posted in these docs does not work if I cut and paste. I get a compile error stating that _root is not a Window; type mismatch.
No screen name said on Sep 4, 2008 at 3:16 PM :
FYI, a Window component is required in the Library of the FLA file, or the above code example will 'fail' with no explanation.

Also, see PopUpManager.deletePopUp() for an alternative import'd / unqualified reference way to code this.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/9.0/main/00003354.html