MACROMEDIA FLASH MEDIA SERVER 2-SERVER-SIDE ACTIONSCRIPT LANGUAGE Reference page 51

Server-side actionscript language reference
Table of Contents

Advertisement

Usage
clientObject.call(methodName, [resultObj, [p1, ..., pN]])
Parameters
A method specified in the form
. For example, the
methodName
[objectPath/]method
command
tells the client to invoke the
someObj/doSomething
method on the client.
NetConnection.someObj.doSomething
An optional parameter that is required when the sender expects a return value
resultObj
from the client. If parameters are passed but no return value is desired, pass the value
.
null
The result object can be any object you define and, in order to be useful, should have two
methods that are invoked when the result arrives:
and
. The
onResult
onStatus
event is triggered if the invocation of the remote method is successful;
resultObj.onResult
otherwise, the
event is triggered.
resultObj.onStatus
Optional parameters that can be of any ActionScript type, including a
p1, ..., pN
reference to another ActionScript object. These parameters are passed to the
methodName
parameter when the method executes on the Flash client. If you use these optional parameters,
you must pass in some value for
; if you do not want a return value, pass
.
resultObject
null
Returns
A Boolean value of
if a call to
was successful on the client; otherwise,
true
methodName
.
false
Description
Method; executes a method on the originating Flash client or on another server. The remote
method may optionally return data, which is returned as a result to the
parameter,
resultObj
if it is provided. The remote object is typically a Flash client connected to the server, but it can
also be another server. Whether the remote agent is a Flash client or another server, the
method is called on the remote agent's NetConnection object.
Example
The following example shows a client-side script that defines a function called
,
random()
which generates a random number:
nc = new NetConnection();
nc.connect ("rtmp://someserver/someApp/someInst");
nc.random = function(){
return (Math.random());
};
Client class
51

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MEDIA SERVER 2-SERVER-SIDE ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash media server 2

Table of Contents