Flashscript classes (ActionScript 3) | Home | MX | MX 2004 | Flash 8 | Flash 9 |Flash 10 |PHP |Components | Snippets | Contact |

AlertBox

Package:
Class:
Inheritance:
biz.flashscript.components.alert
public class AlertBox
Sprite
The AlertBox class is used for an Alert component. To create an instance of the AlertBox use the constructor new AlertBox(). Options exist to make use of a "Yes" and "No" button for decision making. The AlertBox component is best used in combination with the CallAlert or Confirm classes.

See also

   biz.flashscript.components.alert.CallAlert

   biz.flashscript.components.alert.Confirm

Public Properties
Property Defined By
myBlur : int
Will cause blurring of the background.
AlertBox
myLabel : String
The label shown in the component instance.
AlertBox
positionx : int
The x position of the component instance.
AlertBox
positiony : int
The y position of the component instance.
AlertBox
textCol : uint
The color of the label.
AlertBox
textFormat : TextFormat
The TextFormat for the label.
AlertBox
yes_noAlert : Boolean
Whether a the yes-no buttons will be shown.
AlertBox
Public Methods
Method Defined By
AlertBox()
Creates a new instance of the AlertBox component.
AlertBox
Events
Event Defined By
All inherited events for the Sprite class.
Property Detail
myBlur property
myBlur:int [read-write]

Setting a value will cause blurring depending on the value.

The default value is 0.

.

Implementation

public function get myBlur():int
public function set myBlur(value:int):void

myLabel property
myLabel:String [read-write]

This defines the label for the AlertBox component.

The default value is defaulValue.

.

Implementation

public function get myLabel():String
public function set myLabel(value:String):void

positionx property
positionx:int [read-write]

This is the x position for the AlertBox component. If it is 0 the x position of the component instance will be automatically the center of the stage.

The default value is 0.

Implementation

public function get positionx():int
public function set positionx(value:int):void

positiony property
positiony:int [read-write]

This is the y position for the AlertBox component. If it is 0 the y position of the component instance will be automatically the center of the stage.

The default value is 0.

Implementation

public function get positiony():int
public function set positiony(value:int):void

textCol property
textCol:uint [read-write]

This defines the textcolor for the label.

The default value is 0x000000.

Implementation

public function get textCol():uint
public function set textCol(value:uint):void

textFormat property
textFormat:TextFormat [read-write]

This will implement a new textformat for the label.

The default value is the Flash TextFormat default format.

Implementation

public function get textFormat():TextFormat
public function set textFormat(value:TextFormat):void

yes_noAlert property
yes_noAlert:Boolean [read-write]

If set to true the AlertBox instance will have two buttons. There is no function associated with the buttons.

The default value is 0.

Implementation

public function get yes_noAlert():Boolean
public function set yes_noAlert(value:Boolean):void

See also

   biz.flashscript.components.alert.CallAlert

Constructor Detail
AlertBox ()  Constructor
public function AlertBox()
Intializes a new AlertBox instance.
Examples
Create a new fla file and name it AlertBox.fla. Place the fla in the same folder as the biz folder. Add any kind of objects on the main timeline. Then add this script in a frame on the main timeline and test movie. You should see an AlertBox instance popping up and the background blurred.
import biz.flashscript.components.alert.AlertBox;
import flash.events.*;

var format:TextFormat = new TextFormat ();
format.align = TextFormatAlign.CENTER;
format.font = "Lucida Fax";
format.size = 20;
format.bold = true;
format.italic = true;

var myAlert:AlertBox = new AlertBox ();
myAlert.name = "alertBox";
myAlert.textFormat = format;
myAlert.textCol = 0xFF0000;
myAlert.myLabel = "This is working well right now!";
myAlert.yes_noAlert = true;
addChild (myAlert);
myAlert.yBut.addEventListener (MouseEvent.CLICK, yesAlert);
function yesAlert (ev:MouseEvent):void
{
	trace ("YES!");
}
myAlert.nBut.addEventListener (MouseEvent.CLICK, noAlert);
function noAlert (ev:MouseEvent):void
{
	trace ("NO!");
}