Packagecom.wadedwalker.nativeExtension.telephone.events
Classpublic final class CallStateEvent
InheritanceCallStateEvent Inheritance flash.events.Event

Language Version : ActionScript 3.0
Runtime Versions : AIR 2.5

The CallStateEvent object is used for knowing when a call state change has occured on the phone. The three states are: CALL_STATE_RINGING, CALL_STATE_IDLE, and CALL_STATE_OFFHOOK. When this event is dispatched, if the type is of CALL_STATE_RINGING then the phoneNumber property will be populated with the phone number if it can be retrieved.

NOTE: The phone number is not formatted.

NOTE: Requires Android Permission: READ_PHONE_STATE.

See also

TelephoneManager.CALL_STATE_IDLE
TelephoneManager.CALL_STATE_RINGING
TelephoneManager.CALL_STATE_OFFHOOK


Public Properties
 PropertyDefined By
  AIR-only callState : int
The call state of the phone.
CallStateEvent
  AIR-only phoneNumber : String
The incoming telephone number.
CallStateEvent
Public Methods
 MethodDefined By
  
AIR-only CallStateEvent(type:String, callState:int, number:String = null, bubbles:Boolean = true, cancelable:Boolean = false)
Creates a CallStateEvent event.
CallStateEvent
  
AIR-only clone():Event
[override] Duplicates an instance of a CallStateEvent class.
CallStateEvent
  
AIR-only toString():String
[override] Returns a String containing all the properties of the event, CallStateEvent.
CallStateEvent
Public Constants
 ConstantDefined By
  AIR-only CALL_STATE_CHANGE : String = callStateChange
[static] The CALL_STATE_CHANGE constant defines the value of the type property of an callStateChange event object.
CallStateEvent
Property Detail
AIR-only callStateproperty
public var callState:int

Language Version : ActionScript 3.0
Runtime Versions : AIR 2.5

The call state of the phone. This will be CALL_STATE_IDLE, CALL_STATE_RINGING, or CALL_STATE_OFFHOOK.

See also

AIR-only phoneNumberproperty 
public var phoneNumber:String

Language Version : ActionScript 3.0
Runtime Versions : AIR 2.5

The incoming telephone number. This property will only be populated while the phone is ringing and will be unformatted.

Constructor Detail
AIR-only CallStateEvent()Constructor
public function CallStateEvent(type:String, callState:int, number:String = null, bubbles:Boolean = true, cancelable:Boolean = false)

Language Version : ActionScript 3.0
Runtime Versions : AIR 2.5

Creates a CallStateEvent event.

Parameters
type:String
 
callState:int
 
number:String (default = null)
 
bubbles:Boolean (default = true)
 
cancelable:Boolean (default = false)
Method Detail
AIR-only clone()method
override public final function clone():Event

Language Version : ActionScript 3.0
Runtime Versions : AIR 2.5

Duplicates an instance of a CallStateEvent class.

Returns a new CallStateEvent object that is a copy of the original instance of the CallStateEvent object. You do not normally call clone(); the EventDispatcher class calls it automatically when you redispatch an event—that is, when you call dispatchEvent(event) from a handler that is handling event.

The new CallStateEvent object includes all the properties of the original.

Returns
Event — A new CallStateEvent object that is identical to the original.
AIR-only toString()method 
override public final function toString():String

Language Version : ActionScript 3.0
Runtime Versions : AIR 2.5

Returns a String containing all the properties of the event, CallStateEvent.

Returns
String — A string containing all the properties of the CallStateEvent object.
Constant Detail
AIR-only CALL_STATE_CHANGEConstant
public static const CALL_STATE_CHANGE:String = callStateChange

Language Version : ActionScript 3.0
Runtime Versions : AIR 2.5

The CALL_STATE_CHANGE constant defines the value of the type property of an callStateChange event object.

This event is dispatched when a call state change has occured on the phone.

NOTE: Requires Android Permission: READ_PHONE_STATE.

This event has the following properties in addition to standard event properties:

PropertyValue
callStateint value representing the current call state.
phoneNumberString value containing an unformatted phone number. null if the call state is not CALL_STATE_RINGING.