Flex Alert Box example
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
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;
}
12:45 AM
|
|
This entry was posted on 12:45 AM
You can follow any responses to this entry through
the RSS 2.0 feed.
You can leave a response,
or trackback from your own site.
0 comments:
Post a Comment