Search Flex Samples

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




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;
}







0 comments:

Related Flex Samples

Learn Flex: Flex Samples | Flex Video Tutorials Flex Examples