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

CallAlert

Package:
Class:
Inheritance:
biz.flashscript.components.alert
public class CallAlert
EventDispatcher
The CallAlert class opens a default AlertBox instance, for example blurring of a value of 20 is automatically set. To create an instance of the CallAlert class use the constructor new CallAlert(). Options exist to make use of a "Yes" and "No" button for decision making and an event is dispatched when either of the buttons is pressed.

See also

   biz.flashscript.components.alert.AlertBox

   biz.flashscript.components.alert.Confirm

Public Properties
Property Defined By
textFormat : TextFormat
The TextFormat for the label.
CallAlert
myHeight : int
The height of the component instance.
CallAlert
myWidth : int
The width of the component instance.
CallAlert
textCol : uint
The color of the label.
CallAlert
Public Methods
Method Defined By
CallAlert()
Creates a new instance of the CallAlert class.
CallAlert
initAlert(label:String, yesNo:Boolean, target:Object)
Initiates the CallAlert class.
CallAlert
Events
Event Defined By

alertCall

This event is dispatched when the "yes" or "no" button is pressed.

CallAlert
Property Detail

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

myHeight property
myHeight:int [read-write]

This sets the height for the AlertBox component.

The default value is 150.

Implementation

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

myWidth property
myWidth:int [read-write]

This sets the width for the AlertBox component.

The default value is 200.

Implementation

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

textCol property
textCol:uint [read-write]

This defines the textcolor for the label.

The default value is 0x333333.

Implementation

public function get textCol():uint
public function set textCol(value:uint):void
Constructor Detail
CallAlert ()  Constructor
public function CallAlert()
Intializes a new AlertBox instance.
Method Detail

initAlert ()  method
public function initAlert(label:String, yesNo:Boolean, target:Object)

This method will initiate the AlertBox call.

Parameters

  • label:String ____ Specifies the label shown in the AlertBox instance.
  • yesNo:Boolean ____ If set to true the two buttons "yes" and "no" will be shown. Pressing any of the buttons will trigger an event.
  • target:Object ____ Specifies the target for blurring.
Event Detail

alertCall event

Event Object Type: biz.flashscript.components.alert.CallAlert
Event.type property = biz.flashscript.components.alert.CallAlert.ALERT_CALL

Dispatched when a "yes" or "no" button is pressed. To detect, which button was pressed use the instance name and the answer property (see example).

Examples
Create a new fla file and name it CallAlert.fla. Place the fla in the same folder as the biz folder. Add any kind of objects on the main timeline. Then create an Actionscript file, name it Callalerts.as and place this script. Make sure the AlertBox component is installed and in the library of this fla file. You should see an AlertBox instance popping up and the background blurred.
package 
{
	import flash.display.Sprite;
	import flash.events.Event;
	import biz.flashscript.components.alert.CallAlert;

	public class Callalerts extends Sprite
	{
		private var ca:CallAlert;
		public function Callalerts ():void
		{
			ca = new CallAlert();
			ca.textCol = 0xFF0000;
			ca.initAlert ("This is an Alert example",true,this);
			ca.addEventListener (CallAlert.ALERT_CALL, changeHandler);
		}
		private function changeHandler (ev:Event):void
		{
			trace (ca.answer);
		}
	}
}