public static function show(parent:DisplayObjectContainer, text:String, title:String = Alert, flags:Array = null, closeHandler:Function = null, icon:String = null, attributes:AlertAttributes = null, isHTMLText:Boolean = false):Alert
Displays the the alert window
Parameters
| parent:DisplayObjectContainer — Parent object that the alert window will be added to.
|
|
| text:String — Message text that will display in the window.
|
|
| title:String (default = Alert ) — Title to be displayed in the top of the window.
|
|
| flags:Array (default = null ) — Array that signals which buttons to include in the window and in which order. Alert.OK, Alert.CANCEL, Alert.YES, Alert.NO
|
|
| closeHandler:Function (default = null ) — Path to the image to be used as the icon.
|
|
| icon:String (default = null )
|
|
| attributes:AlertAttributes (default = null )
|
|
| isHTMLText:Boolean (default = false )
|
ReturnsThe following example creates a simple alert window.
package
{
import bf.controls.Alert;
import flash.display.MovieClip;
public class AlertExample extends MovieClip
{
public function AlertExample()
{
_init();
}
private function _init():void
{
Alert.show(this, "This is a sample alert.", "Error", [Alert.OK], handleAlert);
}
private function handleAlert(type:int):void
{
switch(type)
{
case Alert.OK:
trace("OK");
break;
}
}
}
}