Paket | mx.rpc |
Klass | public class CallResponder |
Arv | CallResponder EventDispatcher Object |
Implementerar | IResponder |
Språkversion: | ActionScript 3.0 |
Produktversion: | Flex 3 |
Körningsmiljöversioner: | Flash Player 9, AIR 1.1 |
You set the token property of this component to the AsyncToken returned by the
service. You can then add event listeners on this component instead of having to
add them to each AsyncToken returned. This component also maintains the
lastResult property which is a copy of the value returned by the last successful
result event dispatched by a token monitored by this service. Though you can
bind to either the callResponder.token.result
or
callResponder.lastResult
, the latter will be preserved while a second
call to the same service is in progress while the former will be reset as soon
as a new service invocation is started.
Egenskap | Definieras med | ||
---|---|---|---|
constructor : Object
En referens till klassobjektet eller konstruktorfunktionen för en given objektinstans. | Object | ||
lastResult : *
This property stores the result property of the token each time it
delivers a successful result. | CallResponder | ||
token : mx.rpc:AsyncToken
Each CallResponder dispatches result and fault events received
from a single token. | CallResponder |
Metod | Definieras med | ||
---|---|---|---|
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registrerar ett händelseavlyssnarobjekt för ett EventDispatcher-objekt så att avlyssnaren får meddelanden om händelser. | EventDispatcher | ||
Skickar en händelse till händelseflödet. | EventDispatcher | ||
This method is called by the AsyncToken when it wants to deliver a
FaultEvent to the CallResponder. | CallResponder | ||
Kontrollerar om EventDispatcher-objektet har några avlyssnare registrerade för en viss typ av händelse. | EventDispatcher | ||
Anger om det finns en egenskap angiven för ett objekt. | Object | ||
Anger om en instans av klassen Object finns i prototypkedjan för objektet som anges som parameter. | Object | ||
Anger om den angivna egenskapen finns och är uppräkningsbar. | Object | ||
Tar bort en avlyssnare från EventDispatcher-objektet. | EventDispatcher | ||
This method is called by the AsyncToken when it wants to deliver a
ResultEvent to the CallResponder. | CallResponder | ||
Anger tillgänglighet för en dynamisk egenskap för slingåtgärder. | Object | ||
Returnerar det här objektets strängrepresentation, formaterad i enlighet med språkspecifika konventioner. | Object | ||
Returnerar det angivna objektets strängbeteckning. | Object | ||
Returnerar det angivna objektets primitiva värde. | Object | ||
Kontrollerar om en händelseavlyssnare är registrerad för det här EventDispatcher-objektet eller något av dess överordnade objekt för den angivna händelsetypen. | EventDispatcher |
Händelse | Sammanfattning | Definieras med | ||
---|---|---|---|---|
[utsändningshändelse] Skickas när Flash Player eller AIR får operativsystemfokus och blir aktivt. | EventDispatcher | |||
[utsändningshändelse] Skickas när Flash Player eller AIR förlorar operativsystemfokus och blir inaktivt. | EventDispatcher | |||
Dispatched when an Operation call fails. | CallResponder | |||
Dispatched when an Operation invocation successfully returns. | CallResponder |
lastResult | egenskap |
lastResult:*
Språkversion: | ActionScript 3.0 |
Produktversion: | Flex 3 |
Körningsmiljöversioner: | Flash Player 9, AIR 1.1 |
This property stores the result property of the token each time it delivers a successful result. You can bind to or access this property instead of the token.result property to keep your code from seeing that value cleared out on the second and subsequent call to a particular service method. Additionally, if a fault occurs this value will still be set to the last successful result returned by a token monitored by this CallResponder.
Den här egenskapen kan användas som källan för databindning. När den här egenskapen ändras, skickas händelsen propertyChange
.
Implementering
public function get lastResult():*
public function set lastResult(value:any):void
token | egenskap |
token:mx.rpc:AsyncToken
Språkversion: | ActionScript 3.0 |
Produktversion: | Flex 3 |
Körningsmiljöversioner: | Flash Player 9, AIR 1.1 |
Each CallResponder dispatches result and fault events received from a single token. This property value specifies that token. You typically set this property to the AsyncToken object returned by the service.
Den här egenskapen kan användas som källan för databindning. När den här egenskapen ändras, skickas händelsen propertyChange
.
Implementering
public function get token():mx.rpc:AsyncToken
public function set token(value:mx.rpc:AsyncToken):void
fault | () | metod |
public function fault(data:Object):void
Språkversion: | ActionScript 3.0 |
Produktversion: | Flex 3 |
Körningsmiljöversioner: | Flash Player 9, AIR 1.1 |
This method is called by the AsyncToken when it wants to deliver a
FaultEvent
to the CallResponder. You do not call
this method directly.
Parametrar
data:Object — The FaultEvent delivered by the AsyncToken
|
result | () | metod |
public function result(data:Object):void
Språkversion: | ActionScript 3.0 |
Produktversion: | Flex 3 |
Körningsmiljöversioner: | Flash Player 9, AIR 1.1 |
This method is called by the AsyncToken when it wants to deliver a
ResultEvent
to the CallResponder. You do not call
this method directly.
Parametrar
data:Object — The ResultEvent delivered by the AsyncToken
|
fault | Händelse |
mx.rpc.events.FaultEvent
egenskap FaultEvent.type =
mx.rpc.events.FaultEvent.FAULT
Språkversion: | ActionScript 3.0 |
Produktversion: | Flex 3 |
Körningsmiljöversioner: | Flash Player 9, AIR 1.1 |
Dispatched when an Operation call fails.
The FAULT event type.The properties of the event object have the following values:
Property | Value |
---|---|
bubbles | false |
cancelable | true, calling preventDefault() from the associated token's responder.fault method will prevent the service or operation from dispatching this event |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget . |
fault | The Fault object that contains the details of what caused this event. |
message | The Message associated with this event. |
target | The Object that dispatched the event;
it is not always the Object listening for the event.
Use the currentTarget property to always access the
Object listening for the event. |
token | The token that represents the call to the method. Used in the asynchronous completion token pattern. |
result | Händelse |
mx.rpc.events.ResultEvent
egenskap ResultEvent.type =
mx.rpc.events.ResultEvent.RESULT
Språkversion: | ActionScript 3.0 |
Produktversion: | Flex 3 |
Körningsmiljöversioner: | Flash Player 9, AIR 1.1 |
Dispatched when an Operation invocation successfully returns.
The RESULT event type.The properties of the event object have the following values:
Property | Value |
---|---|
bubbles | false |
cancelable | true, preventDefault() from the associated token's responder.result method will prevent the service or operation from dispatching this event |
currentTarget | The Object that defines the
event listener that handles the event. For example, if you use
myButton.addEventListener() to register an event listener,
myButton is the value of the currentTarget . |
message | The Message associated with this event. |
target | The Object that dispatched the event;
it is not always the Object listening for the event.
Use the currentTarget property to always access the
Object listening for the event. |
result | Result that the RPC call returns. |
token | The token that represents the indiviudal call to the method. Used in the asynchronous completion token pattern. |
Tue Jun 12 2018, 01:40 PM Z