User Guide
Alert class (Flash Professional only) 71
15. Drag an Alert component to the Stage and delete it.
This action adds the Alert component to the library and makes it available at runtime.
16. Add ActionScript code to the main timeline to create a sample Alert instance.
import mx.controls.Alert;
Alert.show("This is a skinned Alert component","Title");
17.
Select Control > Test Movie.
Alert class (Flash Professional only)
Inheritance MovieClip > UIObject class > UIComponent class > View > ScrollView >
Window component > Alert
ActionScript Class Name mx.controls.Alert
To use the Alert component, you drag an Alert component to the Stage and delete it so that
the component is in the document library but not visible in the application. Then you call
Alert.show() to display an Alert window. You can pass parameters to Alert.show() that
add a message, a title bar, and buttons to the Alert window.
Because ActionScript is asynchronous, the Alert component is not blocking, which means
that the lines of ActionScript code that follow the call to
Alert.show() run immediately. You
must add listeners to handle the
click events that are broadcast when a user clicks a button
and then continue your code after the event is broadcast.
To understand more about the Alert class, see “Window component” on page 1465 and
“PopUpManager class” on page 987.
Method summary for the Alert class
The following table lists the method of the Alert class.
NOTE
In operating environments that are blocking (for example, Microsoft Windows), a call to
Alert.show() does not return until the user has taken an action, such as clicking a button.
Method Description
Alert.show() Creates an Alert window with optional parameters.