Apache Flex 4.16.1 API Reference | All Packages | All Classes | Index | Frames No Frames |
OnDemandEventDispatcher

Package | mx.utils
Class | public class OnDemandEventDispatcher
Inheritance | OnDemandEventDispatcher Object
Implements | flash.events.IEventDispatcher
Subclasses | AsyncListView, LayoutBase, NumericDataProvider, 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 Methods

| Method | Defined By
--- | --- | ---
|  | OnDemandEventDispatcher() Constructor. | OnDemandEventDispatcher
|  | addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void | OnDemandEventDispatcher
|  | dispatchEvent(event:Event):Boolean | OnDemandEventDispatcher
|  | hasEventListener(type:String):Boolean | OnDemandEventDispatcher
|  | removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void | OnDemandEventDispatcher
|  | willTrigger(type:String):Boolean | OnDemandEventDispatcher

Constructor Detail

OnDemandEventDispatcher | () | Constructor

`public function OnDemandEventDispatcher()`

Language Version : | ActionScript 3.0

Product Version : | Flex 3

Runtime Versions : | Flash Player 9, AIR 1.1

Constructor.

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`

Wed Nov 15 2017, 09:50 AM +01:00