mx.events

# EventListenerRequest - AS3 Flex

Package | mx.events
Class | public class EventListenerRequest
Inheritance | EventListenerRequest SWFBridgeRequest Event Object

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Request sent from one SystemManager to a SystemManager in another application through their bridge to add or remove a listener to a specified event on your behalf. The `data` property is not used. Only certain events can be requested. When the event is triggered in the other application, that event is re-dispatched through the bridge where the requesting SystemManager picks up the event and redispatches it from itself. In general, this request is generated because some other code called the `addEventListener()` method for one of the approved events on its SystemManager. This request is also dispatched by SystemManager to allow the marshal implementation to handle adding or removing listeners differently. When dispatched by the SystemManager, the listener property is non-null;

More examples

Manually dispatching events

Learn more

About Flex events

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | bubbles : Boolean [read-only] Indicates whether an event is a bubbling event. | Event
|  | cancelable : Boolean [read-only] Indicates whether the behavior associated with the event can be prevented. | Event
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object
|  | currentTarget : Object [read-only] The object that is actively processing the Event object with an event listener. | Event
|  | data : Object Data related to the event. | SWFBridgeRequest
|  | eventPhase : uint [read-only] The current phase in the event flow. | Event
|  | eventType : String [read-only] The type of the event to listen to. | EventListenerRequest
|  | listener : Function [read-only] The method or function to call | EventListenerRequest
|  | priority : int [read-only] The priority parameter to addEventListener(). | EventListenerRequest
|  | requestor : IEventDispatcher The bridge that sent the message. | SWFBridgeRequest
|  | target : Object [read-only] The event target. | Event
|  | type : String [read-only] The type of event. | Event
|  | useCapture : Boolean [read-only] The useCapture parameter to addEventListener(). | EventListenerRequest
|  | useWeakReference : Boolean [read-only] The useWeakReference parameter to addEventListener(). | EventListenerRequest

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | EventListenerRequest(type:String, bubbles:Boolean = false, cancelable:Boolean = true, eventType:String = null, listener:Function = null, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false) Creates a new request to add or remove an event listener. | EventListenerRequest
|  | clone():Event Duplicates an instance of an Event subclass. | Event
|  | formatToString(className:String, ... arguments):String A utility function for implementing the toString() method in custom ActionScript 3.0 Event classes. | Event
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isDefaultPrevented():Boolean Checks whether the preventDefault() method has been called on the event. | Event
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | marshal(event:Event):EventListenerRequest [static] Marshals an event by copying the relevant parameters from the event into a new event. | EventListenerRequest
|  | preventDefault():void Cancels an event's default behavior if that behavior can be canceled. | Event
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | stopImmediatePropagation():void Prevents processing of any event listeners in the current node and any subsequent nodes in the event flow. | Event
|  | stopPropagation():void Prevents processing of any event listeners in nodes subsequent to the current node in the event flow. | Event
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns a string containing all the properties of the Event object. | Event
|  | valueOf():Object Returns the primitive value of the specified object. | Object

Public Constants
Hide Inherited Public Constants
Show Inherited Public Constants

| Constant | Defined By
--- | --- | ---
|  | ADD_EVENT_LISTENER_REQUEST : String = "addEventListenerRequest" [static] Request to add an event listener. | EventListenerRequest
|  | REMOVE_EVENT_LISTENER_REQUEST : String = "removeEventListenerRequest" [static] Request to remove an event listener. | EventListenerRequest

Property Detail

### eventType

property

`eventType:String` [read-only]

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

The type of the event to listen to.

Implementation
`public function get eventType():String`

Related API Elements

flash.events.Event.type

### listener

property

`listener:Function` [read-only]

The method or function to call

Implementation
`public function get listener():Function`

Related API Elements

flash.events.IEventDispatcher.addEventListener

### priority

property

`priority:int` [read-only]

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

The `priority` parameter to `addEventListener()`.

Implementation
`public function get priority():int`

Related API Elements

flash.events.IEventDispatcher.addEventListener

### useCapture

property

`useCapture:Boolean` [read-only]

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

The `useCapture` parameter to `addEventListener()`.

Implementation
`public function get useCapture():Boolean`

Related API Elements

flash.events.IEventDispatcher.addEventListener

### useWeakReference

property

`useWeakReference:Boolean` [read-only]

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

The `useWeakReference` parameter to `addEventListener()`.

Implementation
`public function get useWeakReference():Boolean`

Related API Elements

flash.events.IEventDispatcher.addEventListener
Constructor Detail

### EventListenerRequest

()
Constructor

`public function EventListenerRequest(type:String, bubbles:Boolean = false, cancelable:Boolean = true, eventType:String = null, listener:Function = null, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false)`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Creates a new request to add or remove an event listener.

Parameters

| `type:String` — The event type; indicates the action that caused the event. Either `EventListenerRequest.ADD` or `EventListenerRequest.REMOVE`.
| `bubbles:Boolean` (default = `false`)`` — Specifies whether the event can bubble up the display list hierarchy.
| `cancelable:Boolean` (default = `true`)`` — Specifies whether the behavior associated with the event can be prevented.
| `eventType:String` (default = `null`)`` — The type of message you would normally pass to the `addEventListener()` method.
| `listener:Function` (default = `null`)`` — Determines whether the listener works in the capture phase or the target and bubbling phases.
| `useCapture:Boolean` (default = `false`)`` — The priority level of the event listener. Priorities are designated by a 32-bit integer.
| `priority:int` (default = `0`)`` — Determines whether the reference to the listener is strong or weak.
| `useWeakReference:Boolean` (default = `false`)``

Related API Elements

flash.events.IEventDispatcher.addEventListener
Method Detail

### marshal

()
method

`public static function marshal(event:Event):EventListenerRequest`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Marshals an event by copying the relevant parameters from the event into a new event.

Parameters

| `event:Event` — The event to marshal.

Returns

| `EventListenerRequest` — An EventListenerRequest that defines the new event.

Constant Detail

### ADD_EVENT_LISTENER_REQUEST

Constant

`public static const ADD_EVENT_LISTENER_REQUEST:String = "addEventListenerRequest"`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Request to add an event listener.

### REMOVE_EVENT_LISTENER_REQUEST

Constant

`public static const REMOVE_EVENT_LISTENER_REQUEST:String = "removeEventListenerRequest"`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Request to remove an event listener.

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00