Name
NetConnection.call( ) Method
Synopsis
myNetConnectionObject
.call(remoteMethod
,resultObject
,arg1
,...argn
)
Arguments
-
remoteMethod
The name of the server-side method to invoke, in the format
serviceName
.methodName
. The syntax for calling the method varies with the server technology, as described in earlier chapters.-
resultObject
An ActionScript object with an onResult( ) method to handle results from the call to the server-side method. You can also pass
null
, in which case no results are handled.-
arg1
, ...arg
n Zero or more arguments to be passed to the remote method. The third argument passed to the call( ) method (i.e.,
arg1
) is passed as the first argument to the remote method. The next argument,arg2
, is passed as the second argument to the remote method, and so on.
Returns
Return value of the remote method is passed to the
onResult( ) handler of
resultObject
.
Description
The call( ) method is used to invoke a remote
method through the NetConnection object. The
call( ) method is not typically used directly by
a developer. Instead, the developer typically uses the
getService( ) method, which is a wrapper around
the call( ) method that also adds more
functionality. Using call( ), you have to create
responder objects that contain onResult( ) and
onStatus( ) methods; you can’t
use the named function
methodname
_onResult(
) or
methodname
_onStatus(
) techniques shown elsewhere in this book.
Because the call( ) method is a core method of the NetConnection object, you don’t have to include ...
Get Flash Remoting: The Definitive Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.