套件 | mx.rpc |
類別 | public class CallResponder |
繼承 | CallResponder EventDispatcher Object |
實作 | IResponder |
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | 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.
屬性 | 定義自 | ||
---|---|---|---|
constructor : Object
類別物件的參照或是特定物件實體的建構函數。 | 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 |
方法 | 定義自 | ||
---|---|---|---|
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
會在 EventDispatcher 物件註冊事件偵聽程式,以便讓偵聽程式收到事件的通知。 | EventDispatcher | ||
會將事件傳送到事件流程。 | EventDispatcher | ||
This method is called by the AsyncToken when it wants to deliver a
FaultEvent to the CallResponder. | CallResponder | ||
會檢查 EventDispatcher 物件是否有對特定的事件類型註冊偵聽程式。 | EventDispatcher | ||
指出物件是否有已定義的指定屬性。 | Object | ||
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。 | Object | ||
指出指定的屬性是否存在,以及是否可列舉。 | Object | ||
會從 EventDispatcher 物件移除偵聽程式。 | EventDispatcher | ||
This method is called by the AsyncToken when it wants to deliver a
ResultEvent to the CallResponder. | CallResponder | ||
為迴圈作業設定動態屬性的可用性。 | Object | ||
傳回代表此物件的字串,根據地區特定慣例進行格式化。 | Object | ||
會傳回指定之物件的字串形式。 | Object | ||
會傳回指定之物件的基本值。 | Object | ||
檢查此 EventDispatcher 物件是否已註冊事件偵聽程式,或者此物件的任何祖系已為特定事件類型註冊事件偵聽程式。 | EventDispatcher |
事件 | 摘要 | 定義自 | ||
---|---|---|---|---|
[廣播事件] 當 Flash Player 或 AIR 應用程式取得作業系統焦點並成為作用中時傳送。 | EventDispatcher | |||
[廣播事件] 當 Flash Player 或 AIR 應用程式失去作業系統焦點並成為非作用中時傳送。 | EventDispatcher | |||
Dispatched when an Operation call fails. | CallResponder | |||
Dispatched when an Operation invocation successfully returns. | CallResponder |
lastResult | 屬性 |
lastResult:*
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | 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.
此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 propertyChange
事件。
實作
public function get lastResult():*
public function set lastResult(value:any):void
token | 屬性 |
token:mx.rpc:AsyncToken
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | 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.
此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 propertyChange
事件。
實作
public function get token():mx.rpc:AsyncToken
public function set token(value:mx.rpc:AsyncToken):void
fault | () | 方法 |
public function fault(data:Object):void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | 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.
參數
data:Object — The FaultEvent delivered by the AsyncToken
|
result | () | 方法 |
public function result(data:Object):void
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | 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.
參數
data:Object — The ResultEvent delivered by the AsyncToken
|
fault | 事件 |
mx.rpc.events.FaultEvent
屬性 FaultEvent.type =
mx.rpc.events.FaultEvent.FAULT
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | 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 | 事件 |
mx.rpc.events.ResultEvent
屬性 ResultEvent.type =
mx.rpc.events.ResultEvent.RESULT
語言版本: | ActionScript 3.0 |
產品版本: | Flex 3 |
執行階段版本: | 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, 03:47 PM Z