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 Alert.show() does not return until the user has taken an action, such as clicking a button.

To understand more about the Alert class, see Window component and PopUpManager class.

Method summary for the Alert class

The following table lists the method of the Alert class.

Method

Description

Alert.show()

Creates an Alert window with optional parameters.

Methods inherited from the UIObject class

The following table lists the methods the Alert class inherits from the UIObject class.

Method

Description

UIObject.createClassObject()

Creates an object on the specified class.

UIObject.createObject()

Creates a subobject on an object.

UIObject.destroyObject()

Destroys a component instance.

UIObject.doLater()

Calls a function when parameters have been set in the Property and Component inspectors.

UIObject.getStyle()

Gets the style property from the style declaration or object.

UIObject.invalidate()

Marks the object so it is redrawn on the next frame interval.

UIObject.move()

Moves the object to the requested position.

UIObject.redraw()

Forces validation of the object so it is drawn in the current frame.

UIObject.setSkin()

Sets a skin in the object.

UIObject.setStyle()

Sets the style property on the style declaration or object.

Methods inherited from the UIComponent class

The following table lists the methods the Alert class inherits from the UIComponent class.

Method

Description

UIComponent.getFocus()

Returns a reference to the object that has focus.

UIComponent.setFocus()

Sets focus to the component instance.

Methods inherited from the Window class

The following table lists the methods the Alert class inherits from the Window class.

Method

Description

Window.deletePopUp()

Removes a window instance created by PopUpManager.createPopUp().

Property summary for the Alert class

The following table lists properties of the Alert class.

Property

Description

Alert.buttonHeight

The height of each button, in pixels. The default value is 22.

Alert.buttonWidth

The width of each button, in pixels. The default value is 100.

Alert.CANCEL

A constant hexadecimal value indicating whether a Cancel button should be displayed in the Alert window.

Alert.cancelLabel

The label text for the Cancel button.

Alert.NO

A constant hexadecimal value indicating whether a No button should be displayed in the Alert window.

Alert.noLabel

The label text for the No button.

Alert.OK

A constant hexadecimal value indicating whether an OK button should be displayed in the Alert window.

Alert.okLabel

The label text for the OK button.

Alert.YES

A constant hexadecimal value indicating whether a Yes button should be displayed in the Alert window.

Alert.yesLabel

The label text for the Yes button.

Properties inherited from the UIObject class

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

UIObject.bottom

Read-only.The position of the bottom edge of the object, relative to the bottom edge of its parent.

UIObject.height

Read-only; the height of the object, in pixels.

UIObject.left

Read-only; the left edge of the object, in pixels.

UIObject.right

Read-only; the position of the right edge of the object, relative to the right edge of its parent.

UIObject.scaleX

A number indicating the scaling factor in the x direction of the object, relative to its parent.

UIObject.scaleY

A number indicating the scaling factor in the y direction of the object, relative to its parent.

UIObject.top

Read-only; the position of the top edge of the object, relative to its parent.

UIObject.visible

A Boolean value indicating whether the object is visible (true) or not (false).

UIObject.width

Read-only; the width of the object, in pixels.

UIObject.x

Read-only; the left edge of the object, in pixels.

UIObject.y

Read-only; the top edge of the object, in pixels.

Properties inherited from the UIComponent class

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

UIComponent.enabled

Indicates whether the component can receive focus and input.

UIComponent.tabIndex

A number indicating the tab order for a component in a document.

Properties inherited from the Window class

The following table lists the properties the Alert class inherits from the Window class.

Property

Description

Window.closeButton

Indicates whether a close button is (true) or is not (false) included on the title bar.

Window.content

A reference to the content (root movie clip) of the window.

Window.contentPath

Sets the name of the content to display in the window.

Window.title

The text that appears in the title bar.

Window.titleStyleDeclaration

The style declaration that formats the text in the title bar.

Event summary for the Alert class

The following table lists an event of the Alert class.

Event

Description

Alert.click

Broadcast when a button in an Alert window is clicked.

Events inherited from the UIObject class

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

UIObject.draw

Broadcast when an object is about to draw its graphics.

UIObject.hide

Broadcast when an object's state changes from visible to invisible.

UIObject.load

Broadcast when subobjects are being created.

UIObject.move

Broadcast when the object has moved.

UIObject.resize

Broadcast when an object has been resized.

UIObject.reveal

Broadcast when an object's state changes from invisible to visible.

UIObject.unload

Broadcast when the subobjects are being unloaded.

Events inherited from the UIComponent class

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

UIComponent.focusIn

Broadcast when an object receives focus.

UIComponent.focusOut

Broadcast when an object loses focus.

UIComponent.keyDown

Broadcast when a key is pressed.

UIComponent.keyUp

Broadcast when a key is released.

Events inherited from the Window class

The following table lists the events the Alert class inherits from the Window class.

Event

Description

Window.click

Broadcast when the close button is clicked (released).

Window.complete

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