ActionScript 2.0 Components Language Reference |
|
|
|
| Window component > Window.closeButton | |||
Flash Player 6 (6.0.79.0).
Flash MX 2004.
windowInstance.closeButton
Property; a Boolean value that indicates whether the title bar should have a close button (true) or not (false). This property must be set in the initObject parameter of the PopUpManager.createPopUp() method. The default value is false.
Clicking the close button broadcasts a click event, but doesn't close the window. You must write a handler that calls Window.deletePopUp() to explicitly close the window. For more information about the click event, see Window.click.
The following example creates a pop-up window and sets the closeButton property to add a close button to it. You drag a Window component from the Components panel to the current document's library, and then add the following code to Frame 1:
/**
Requires:
- Window component in library
*/
import mx.managers.PopUpManager;
import mx.containers.Window;
System.security.allowDomain("http://www.flash-mx.com");
var my_win:MovieClip = PopUpManager.createPopUp(this, Window, true, {closeButton:true, contentPath:"http://www.flash-mx.com/images/image1.jpg"});
PopUpManager.createPopUp(), Window.click
|
|
|
|