![]() ![]() ![]() | |
![]() | |
![]() | |
![]() |
Inheritance UIObject > UIComponent > View > ScrollView > Window
ActionScript Class Namespace mx.containers.Window
The properties of the Window class allow you to set the title caption, add a close button, and set the display content at runtime. Setting a property of the Window class with ActionScript overrides the parameter of the same name set in the Property inspector or Component Inspector panel.
The best way to instantiate a window is to call PopUpManager.createPopUp()
. This method creates a window that can be modal (overlapping and disabling existing objects in an application) or non-modal. For example, the following code creates a modal Window instance (the last parameter indicates modality):
var newWindow = PopUpManager.createPopUp(this, Window, true);
Modality is simulated by creating a large transparent window underneath the Window component. Due to the way transparent windows are rendered, you may notice a slight dimming of the objects under the transparent window. The effective transparency can be set by changing the _global.style.modalTransparency
value from 0 (fully transparent) to 100 (opaque). If you make the window partially transparent, you can also set the color of the window by changing the Modal skin in the default theme.
If you use PopUpManager.createPopUp()
to create a modal Window, you must call Window.deletePopUp()
to remove it to so that the transparent window is also removed. For example, if you use the closeButton on the window you would write the following code:
obj.click = function(evt){ this.deletePopUp(); } window.addEventListener("click", obj);
Note: Code does not stop executing when a modal window is created. In other environments (for example Microsoft Windows), if you create a modal window, the lines of code that follow the creation of the window do not run until the window is closed. In Flash, the lines of code are run after the window is created and before it is closed.
Each component class has a version
property which is a class property. Class properties are only available on the class itself. The version
property returns a string that indicates the version of the component. To access the version
property, use the following code:
trace(mx.containers.Window.version);
Note: The following code returns undefined: trace(myWindowInstance.version);
.
Method |
Description |
---|---|
|
Removes a window instance created by |
Inherits all methods from UIObject class, UIComponent class, and View.
Property |
Description |
---|---|
|
Indicates whether a close button is included on the title bar ( |
|
A reference to the content specified in the |
|
A path to the content that is displayed in the window. |
|
The text that displays in the title bar. |
|
The style declaration that formats the text in the title bar. |
Inherits all properties from UIObject class, UIComponent class, and ScrollView.
Event |
Description |
---|---|
|
Triggered when the close button is released. |
|
Triggered when the mouse is pressed outside the modal window. |
Inherits all events from UIObject class, UIComponent class, View, and ScrollView.
![]() | |
![]() | |
![]() | |
![]() ![]() ![]() |