Flash 8 Documentation |
|||
| Components Language Reference > Alert component (Flash Professional only) > 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.
|
NOTE |
|
In operating environments that are blocking (for example, Microsoft Windows), a call to |
To understand more about the Alert class, see Window component and PopUpManager class.
The following table lists the method of the Alert class.
|
Method |
Description |
|---|---|
|
Creates an Alert window with optional parameters. |
The following table lists the methods the Alert class inherits from the UIObject class.
|
Method |
Description |
|---|---|
|
Creates an object on the specified class. |
|
|
Creates a subobject on an object. |
|
|
Destroys a component instance. |
|
|
Calls a function when parameters have been set in the Property and Component inspectors. |
|
|
Gets the style property from the style declaration or object. |
|
|
Marks the object so it is redrawn on the next frame interval. |
|
|
Moves the object to the requested position. |
|
|
Forces validation of the object so it is drawn in the current frame. |
|
|
Sets a skin in the object. |
|
|
Sets the style property on the style declaration or object. |
The following table lists the methods the Alert class inherits from the UIComponent class.
|
Method |
Description |
|---|---|
|
Returns a reference to the object that has focus. |
|
|
Sets focus to the component instance. |
The following table lists the methods the Alert class inherits from the Window class.
|
Method |
Description |
|---|---|
|
Removes a window instance created by PopUpManager.createPopUp(). |
The following table lists properties of the Alert class.
|
Property |
Description |
|---|---|
|
The height of each button, in pixels. The default value is 22. |
|
|
The width of each button, in pixels. The default value is 100. |
|
|
A constant hexadecimal value indicating whether a Cancel button should be displayed in the Alert window. |
|
|
The label text for the Cancel button. |
|
|
A constant hexadecimal value indicating whether a No button should be displayed in the Alert window. |
|
|
The label text for the No button. |
|
|
A constant hexadecimal value indicating whether an OK button should be displayed in the Alert window. |
|
|
The label text for the OK button. |
|
|
A constant hexadecimal value indicating whether a Yes button should be displayed in the Alert window. |
|
|
The label text for the Yes button. |
The following table lists the properties the Alert class inherits from the UIObject class. When calling these properties from the Alert object, use the form Alert.propertyName.
|
Property |
Description |
|---|---|
|
Read-only.The position of the bottom edge of the object, relative to the bottom edge of its parent. |
|
|
Read-only; the height of the object, in pixels. |
|
|
Read-only; the left edge of the object, in pixels. |
|
|
Read-only; the position of the right edge of the object, relative to the right edge of its parent. |
|
|
A number indicating the scaling factor in the x direction of the object, relative to its parent. |
|
|
A number indicating the scaling factor in the y direction of the object, relative to its parent. |
|
|
Read-only; the position of the top edge of the object, relative to its parent. |
|
|
A Boolean value indicating whether the object is visible ( |
|
|
Read-only; the width of the object, in pixels. |
|
|
Read-only; the left edge of the object, in pixels. |
|
|
Read-only; the top edge of the object, in pixels. |
The following table lists the properties the Alert class inherits from the UIComponent class. When calling these properties from the Alert object, use the form Alert.propertyName.
|
Property |
Description |
|---|---|
|
Indicates whether the component can receive focus and input. |
|
|
A number indicating the tab order for a component in a document. |
The following table lists the properties the Alert class inherits from the Window class.
|
Property |
Description |
|---|---|
|
Indicates whether a close button is ( |
|
|
A reference to the content (root movie clip) of the window. |
|
|
Sets the name of the content to display in the window. |
|
|
The text that appears in the title bar. |
|
|
The style declaration that formats the text in the title bar. |
The following table lists an event of the Alert class.
|
Event |
Description |
|---|---|
|
Broadcast when a button in an Alert window is clicked. |
The following table lists the events the Alert class inherits from the UIObject class. When calling these events from the Alert object, use the form Alert.eventName.
|
Event |
Description |
|---|---|
|
Broadcast when an object is about to draw its graphics. |
|
|
Broadcast when an object's state changes from visible to invisible. |
|
|
Broadcast when subobjects are being created. |
|
|
Broadcast when the object has moved. |
|
|
Broadcast when an object has been resized. |
|
|
Broadcast when an object's state changes from invisible to visible. |
|
|
Broadcast when the subobjects are being unloaded. |
The following table lists the events the Alert class inherits from the UIComponent class. When calling these events from the Alert object, use the form Alert.eventName.
|
Event |
Description |
|---|---|
|
Broadcast when an object receives focus. |
|
|
Broadcast when an object loses focus. |
|
|
Broadcast when a key is pressed. |
|
|
Broadcast when a key is released. |
The following table lists the events the Alert class inherits from the Window class.
|
Event |
Description |
|---|---|
|
Broadcast when the close button is clicked (released). |
|
|
Broadcast when a window is created. |
Version 8
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/8/main/00003100.html