Packagecom.joebillman.controls
Classpublic class Alert
InheritanceAlert Inheritance flash.display.Sprite

Alert: Creates an alert window.

View the examples



Public Methods
 MethodDefined By
  
show(parent:DisplayObjectContainer, text:String, title:String = Alert, flags:Array = null, closeHandler:Function = null, icon:String = null, attributes:AlertAttributes = null, isHTMLText:Boolean = false):Alert
[static] Displays the the alert window
Alert
Public Constants
 ConstantDefined By
  CANCEL : int = 0
[static]
Alert
  NO : int = 1
[static]
Alert
  OK : int = 2
[static]
Alert
  YES : int = 3
[static]
Alert
Method Detail
show()method
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)

Returns
Alert
Constant Detail
CANCELConstant
public static const CANCEL:int = 0

NOConstant 
public static const NO:int = 1

OKConstant 
public static const OK:int = 2

YESConstant 
public static const YES:int = 3

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