| Package | com.vmware.flexutil.events |
| Class | public class MethodReturnEvent |
| Inheritance | MethodReturnEvent flash.events.Event |
| Property | Defined By | ||
|---|---|---|---|
| callContext : Object [read-only]
This property represents an arbitrary call context supplied by the caller to the
callee when invoking the method whose completion is represented by this event. | MethodReturnEvent | ||
| callee : Object [read-only]
The callee object is the target of the method invocation whose completion is
represented by this event. | MethodReturnEvent | ||
| error : Error [read-only]
The error resulting from the method invocation whose completion is represented
by this event. | MethodReturnEvent | ||
| result : Object [read-only]
The result or return value from the method invocation whose completion is
represented by this event. | MethodReturnEvent | ||
| Method | Defined By | ||
|---|---|---|---|
MethodReturnEvent(result:Object, error:Error, callContext:Object = null, callee:Object = null, eventId:String)
Initializes a new instance of this class. | MethodReturnEvent | ||
clone():Event [override]
Creates a clone of this event. | MethodReturnEvent | ||
newErrorEvent(error:Error, callContext:Object = null, callee:Object = null):MethodReturnEvent [static]
A convenience factory method for this class that assumes null value for the result. | MethodReturnEvent | ||
newResultEvent(result:Object, callContext:Object = null, callee:Object = null):MethodReturnEvent [static]
A convenience factory method for this class that assumes null value for the error. | MethodReturnEvent | ||
| Constant | Defined By | ||
|---|---|---|---|
| DEFAULT_RETURN_ID : String = methodReturn [static]
This string is used for the type property if no custom id is provided
to the constructor. | MethodReturnEvent | ||
| callContext | property |
callContext:Object [read-only] This property represents an arbitrary call context supplied by the caller to the callee when invoking the method whose completion is represented by this event.
public function get callContext():Object| callee | property |
callee:Object [read-only] The callee object is the target of the method invocation whose completion is represented by this event.
public function get callee():Object| error | property |
error:Error [read-only] The error resulting from the method invocation whose completion is represented by this event.
public function get error():Error| result | property |
result:Object [read-only] The result or return value from the method invocation whose completion is represented by this event.
public function get result():Object| MethodReturnEvent | () | Constructor |
public function MethodReturnEvent(result:Object, error:Error, callContext:Object = null, callee:Object = null, eventId:String)Initializes a new instance of this class.
Parametersresult:Object — Value for the result property.
| |
error:Error — Value for the error property.
| |
callContext:Object (default = null) — Value for the callContext property.
| |
callee:Object (default = null) — Value for the callee property.
| |
eventId:String (default = NaN) — Value for the type property.
|
| clone | () | method |
override public function clone():EventCreates a clone of this event. All custom events should override this method.
ReturnsEvent —
A clone of this event.
|
| newErrorEvent | () | method |
public static function newErrorEvent(error:Error, callContext:Object = null, callee:Object = null):MethodReturnEventA convenience factory method for this class that assumes null value for the result.
Parameters
error:Error — Value for the error property.
| |
callContext:Object (default = null) — Value for the callContext property.
| |
callee:Object (default = null) — Value for the callee property.
|
MethodReturnEvent |
| newResultEvent | () | method |
public static function newResultEvent(result:Object, callContext:Object = null, callee:Object = null):MethodReturnEventA convenience factory method for this class that assumes null value for the error.
Parameters
result:Object — Value for the result property.
| |
callContext:Object (default = null) — Value for the callContext property.
| |
callee:Object (default = null) — Value for the callee property.
|
MethodReturnEvent |
| DEFAULT_RETURN_ID | Constant |
public static const DEFAULT_RETURN_ID:String = methodReturn
This string is used for the type property if no custom id is provided
to the constructor.
private function onButtonClick(click:MouseEvent):void {
// Asynchronous call to the java service
_proxy.echo("hello", onMethodResult);
}
private function onMethodResult(event:MethodReturnEvent):void {
if (event.error != null) {
Alert.show("Error calling echo: " + event.error.message);
} else {
Alert.show(event.result as String);
}
}