This class provides a place to set additional or token-level data for asynchronous RPC operations. It also allows an IResponder to be attached for an individual call. The AsyncToken can be referenced in ResultEvent and FaultEvent from the token property.

Constructor

@:value({ message : null })new(?message:IMessage)

Constructs an instance of the token with the specified message.

Parameters:

message

The message with which the token is associated.

Variables

@:flash.propertyread onlymessage:IMessage

Provides access to the associated message.

@:flash.propertyread onlyresponders:Array<IResponder>

An array of IResponder handlers that will be called when the asynchronous request completes.

Each responder assigned to the token will have its result or fault function called passing in the matching event before the operation or service dispatches the event itself.

A developer can prevent the service from subsequently dispatching the event by calling event.preventDefault().

Note that this will not prevent the service or operation's result property from being assigned.

@:flash.propertyread onlyresult:Dynamic

The result that was returned by the associated RPC call. Once the result property on the token has been assigned it will be strictly equal to the result property on the associated ResultEvent.

Methods

addResponder(responder:IResponder):Void

Adds a responder to an Array of responders. The object assigned to the responder parameter must implement mx.rpc.IResponder.

Parameters:

responder

A handler which will be called when the asynchronous request completes.

See also:

  • mx.rpc.IResponder

hasResponder():Bool

Determines if this token has at least one mx.rpc.IResponder registered.

Returns:

true if at least one responder has been added to this token.