User Guide

Window component 891
Example
The following code creates a modal window, then creates a listener that deletes the window when
the close button is clicked:
import mx.managers.PopUpManager;
import mx.containers.Window;
var myTW:MovieClip = PopUpManager.createPopUp(_root, Window, true,
{closeButton:true, title:"Test"});
var twListener:Object = new Object();
twListener.click = function(evt:Object){
evt.target.deletePopUp();
}
myTW.addEventListener("click", twListener);
Note: Remember to add a Window component to the Stage then delete it to add it to the Library
before running the above code.
Window.mouseDownOutside
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX 2004.
Usage
Usage 1:
on(mouseDownOutside){
...
}
Usage 2:
listenerObject = new Object();
listenerObject.mouseDownOutside = function(eventObject){
...
}
windowInstance.addEventListener("mouseDownOutside", listenerObject)
Description
Event; broadcast to all registered listeners when the mouse is clicked (released) outside the modal
window. This event is rarely used, but you can use it to dismiss a window if the user tries to
interact with something outside of it.
The first usage example uses an
on() handler and must be attached directly to a Window
instance. The keyword
this, used inside an on() handler attached to a component, refers to the
component instance. For example, the following code, attached to the Window instance
myWindowComponent, sends “_level0.myWindowComponent” to the Output panel:
on(mouseDownOutside){
trace(this);
}