ActionScript 2.0 Components Language Reference |
|
|
|
| Alert component > Alert.NONMODAL | |||
Flash Player 6 (6.0.79.0).
Flash MX Professional 2004.
Alert.NONMODAL
Property (constant); a property with the constant hexadecimal value 0x8000. This property can be used for the flags parameter of the Alert.show() method. This property indicates that an Alert window should be nonmodal, which allows users to interact with buttons and instances underneath the displayed window. By default, windows generated with Alert.show() are modal, which means that users cannot click anything except the currently open window.
The following example displays two Button component instances on the Stage. Clicking one button opens a modal window, which prevents the user from further clicking the buttons until the Alert window is closed. The second button opens a nonmodal window, which allows the user to continue clicking the buttons underneath the currently open nonmodal Alert window. To test this example, add instances of both the Alert component and the Button component to the current document's library and add the following code to Frame 1 of the main timeline:
import mx.controls.Alert;
this.createClassObject(mx.controls.Button, "modal_button", 10, {_x:10, _y:10});
this.createClassObject(mx.controls.Button, "nonmodal_button", 20, {_x:120, _y:10});
modal_button.label = "modal";
modal_button.addEventListener("click", modalListener);
function modalListener(evt_obj:Object):Void {
var a:Alert = Alert.show("This is a modal Alert window", "Alert Test", Alert.OK, this);
a.move(100, 100);
}
nonmodal_button.label = "nonmodal";
nonmodal_button.addEventListener("click", nonmodalListener);
function nonmodalListener(evt_obj:Object):Void {
var a:MovieClip = Alert.show("This is a nonmodal Alert window", "Alert Test", Alert.OK | Alert.NONMODAL, this);
a.move(100, 100);
}
|
|
|
|