HTML/CSS Service

Flex Alert Box example

Category: Flex Examples    |    10,326 views

Alert box is a dialog box that appears on window with some message and stays rigid until the event associated with it is not done. Alert Box is also referred to as pop-up window.

Among these two words Alert & box, Alert is a class defined inside the mx.controls package. The pop-up window appears when .show() method of Alert class is called. Programmer can write its message inside the method parenthesis, method displays programmers message as string on the opened pop-up window that contains a string title ‘Alert’.

alert.mxml


width = '100%' height = '100%'>


import mx.controls.Alert;
import mx.events.CloseEvent;


public function method1():void{
Alert.show(’want to play’, ‘message’, 3, this, method2)
}

public function method2(event:CloseEvent):void{
if(event.detail == Alert.YES)
eve.text = “You answer is ‘yes’ so your player ID is: ” + event.detail;
else
eve.text = “You answer is ‘No’ but still if want to play then your player ID is: ”
+ event.detail;
}


Share/Save/Bookmark

1 Star2 Stars (+13)

Tags:

1 response so far!

Leave a Comment

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word