Alert Component (Flash Professional Only) - MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual

Using components
Hide thumbs Also See for FLASH MX 2004-USING COMPONENTS:
Table of Contents

Advertisement

Alert component (Flash Professional only)

The Alert component lets you display a window that presents the user with a message and
response buttons. The window has a title bar that you can fill with text, a message that you can
customize, and buttons whose labels you can change. An Alert window can have any combination
of Yes, No, OK, and Cancel buttons, and you can change the button labels by using the
Alert.yesLabel
cannot change the order of the buttons in an Alert window; the button order is always OK, Yes,
No, Cancel. An Alert window closes when a user clicks any of its buttons.
To display an Alert window, call the
successfully, the Alert component must be in the library. By dragging the Alert component from
the Components panel to the Stage and then deleting the component, you add the component to
the library without making it visible in the document.
The live preview for the Alert component is an empty window.
When you add an Alert component to an application, you can use the Accessibility panel to make
the component's text and buttons accessible to screen readers. First, add the following line of code
to enable accessibility:
mx.accessibility.AlertAccImpl.enableAccessibility();
Note: You enable accessibility for a component only once, regardless of how many instances you
have of the component.
Using the Alert component (Flash Professional only)
You can use an Alert component whenever you want to announce something to a user. For
example, you could display an alert when a user doesn't fill out a form properly, when a stock hits
a certain price, or when a user quits an application without saving the session.
Alert parameters
The Alert component has no authoring parameters. You must call the ActionScript
method to display an Alert window. You can use other ActionScript properties to
Alert.show()
modify the Alert window in an application. For more information, see
Professional only)" on page
Creating an application with the Alert component
The following procedure explains how to add an Alert component to an application while
authoring. In this example, the Alert component appears when a stock hits a certain price.
To create an application with the Alert component:
Double-click the Alert component in the Components panel to add it to the Stage.
1.
Press Backspace (Windows) or Delete (Macintosh) to delete the component from the Stage.
2.
This adds the component to the library, but doesn't make it visible in the application.
,
,
Alert.click
Alert.okLabel
Alert.show()
119.
Components Dictionary
, and
Alert.cancelLabel
method. In order to call the method
"Alert class (Flash
Alert component (Flash Professional only)
CHAPTER 6
properties. You
115

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?

This manual is also suitable for:

Flash mx

Table of Contents