MethodInvocationReturnListener awaits a return value of a method invocation.
This interface can either be instantiated directly or implemented by a class. If you instantiate it directly you must overwrite the event method with an anonymous function.
Note that overwriting the event method with a anonymous function is error-prone,
because the arguments' types and the return type are not type-checked. Instantiating
an interface directly is also not permitted in Flex.
var listener:MethodInvocationReturnListener = new MethodInvocationReturnListener();
listener.onReturn = function(returnInfo:MethodInvocationReturnInfo):Void) {
trace("Invoked method successfully: " + returnInfo);
}
Implementing the interface by a class is a much neater way. But sometimes it
adds unnecessary complexity.
class MyListener implements MethodInvocationReturnListener {
public function onReturn(returnInfo:MethodInvocationReturnInfo):Void {
trace("Invoked method successfully: " + returnInfo);
}
}
public function onReturn(returnInfo:MethodInvocationReturnInfo):VoidIs executed when the return value of the method invocation arrives.
This indicates that the method was invoked successfully.
returnInfo | contains the return value and some other useful information about the invoked method |