ASTRA AlertManager
AlertManager is a UI component that creates and manages the queuing of alert windows in a Flash Application.
Using AlertManager in Flash CS3
In Getting Started, we created a simple AlertManager. We will use a form field to customize and display an alert.
We can start by placing the following elements on the stage:
- Input text field with an instance name of
titleTextto be used to input the title. - Input text field with an instance name of
alertTextto be used to input the dialog message. - Input text field with an instance name of
buttonNames. We will use this to input a comma delimited list of button names. - ComboBox component with an instance name of
iconSelectorfor selecting the icon class. - Dynamic text field with and instance name of
outputText. This will display the label of the button that the user clicked on.
On the first frame of our application, we will import the necessary classes and align the movie.
Next, we will create a variable to hold the class name to be used for the icon, populate the iconSelector ComboBox and add a listener and handler that will populate the iconClass variable when a new item is selected.
We will give a label to the showCode Button and add a listener and handler to it's click event. The handler function will take values for the alert fields from our stage elements and pass them as parameters along with a handler function to the static createAlert method on the AlertManager
Finally, we will create a handler function that will display which alert button clicked on.
Example: Customized Alert Example
To see a live example, please install Adobe Flash Player version 9 or higher.
Download the FLA file.
For additional information, please take a look at the Examples section for functional demonstrations and the ActionScript 3.0 Class Reference for full details on every property, method, and style available to the AlertManager component.