The following server-side script uses the
application.onConnect
client side. The server-side script also defines a function called
in the
Client.call()
application.onConnect = function(clientObj){
trace("we are connected");
application.acceptConnection(clientObj);
clientObj.call("random", new randHandler());
};
randHandler = function(){
this.onResult = function(res){
trace("random num: " + res);
}
this.onStatus = function(info){
trace("failed and got:" + info.code);
}
};
Client."commandName"
Availability
Flash Communication Server MX 1.0.
Usage
function clientCommand([p1, ..., pN]){}
Parameters
Optional parameters passed to the command message handler if the message
p1, ..., pN
contains parameters you defined. These parameters are the ActionScript objects passed to the
NetConnection.call()
Returns
Any ActionScript object you define. This object is serialized and sent to the client as a
response to the command only if the command message supplied a response handler.
Description
Event handler; invoked when a Flash client or another server calls the
NetConnection.call()
NetConnection.call()
Client object instance on the server side for a method that matches the command name
parameter. If the parameter is found, the method is invoked and the return value is sent back
to the client.
52
Server-Side ActionScript Language Reference
Client.call()
handler to call the
method as the
resultObj
method.
method. A command name parameter is passed to
on the client side, which causes Flash Media Server to search the
method in the
method that was defined on the
random()
randHander()
parameter.
, which is used
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?