Adobe® Flex® 4 Language Reference
Hide Packages and Classes List |  Packages  |  Classes  |  Index  |  Appendixes
mx.utils 
OnDemandEventDispatcher 
Packagemx.utils
Classpublic class OnDemandEventDispatcher
InheritanceOnDemandEventDispatcher Inheritance Object
Implements IEventDispatcher
Subclasses AsyncListView, LayoutBase, OverrideBase

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

OnDemandEventDispatcher serves as a base class for classes that dispatch events but expect listeners to be infrequent. When a class extends OnDemandEventDispatcher instead of the standard EventDispatcher, it is trading off a small overhead on every single instance for a slightly larger overhead on only the instances that actually have listeners attached to them.



Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
Public Methods
 MethodDefined By
  
OnDemandEventDispatcher
  
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
OnDemandEventDispatcher
  
OnDemandEventDispatcher
  
OnDemandEventDispatcher
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
  
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
OnDemandEventDispatcher
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
  
OnDemandEventDispatcher
Constructor Detail

OnDemandEventDispatcher

()Constructor
public function OnDemandEventDispatcher()



Method Detail

addEventListener

()method
public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Parameters

type:String
 
listener:Function
 
useCapture:Boolean (default = false)
 
priority:int (default = 0)
 
useWeakReference:Boolean (default = false)

dispatchEvent

()method 
public function dispatchEvent(event:Event):Boolean

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Parameters

event:Event

Returns
Boolean

hasEventListener

()method 
public function hasEventListener(type:String):Boolean

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Parameters

type:String

Returns
Boolean

removeEventListener

()method 
public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Parameters

type:String
 
listener:Function
 
useCapture:Boolean (default = false)

willTrigger

()method 
public function willTrigger(type:String):Boolean

Language Version: ActionScript 3.0
Product Version: Flex 3
Runtime Versions: Flash Player 9, AIR 1.1

Parameters

type:String

Returns
Boolean