Netconnection.close - MACROMEDIA FLASH COMMUNICATION SERVER MX-SERVER-SIDE COMMUNICATION ACTIONSCRIPT DICTIONARY Manual

Server-side communication actionscript dictionary
Table of Contents

Advertisement

Description
Method; invokes a command or method on a Flash Communication Server or an application
server to which the application instance is connected. The
server works the same way as the
command on a remote server.
Note: If you want to call a method on a client from a server, use the
Example
This example uses RTMP to execute a call from one Flash Communication Server to another
Flash Communication Server. The code makes a connection to the App1 application on server 2
and then invokes the method
nc1.connect("rtmp://server2.mydomain.com/App1", "svr2",);
nc1.call("Sum", newResult(), 3, 6);
The following server-side ActionScript code is on server 2. When the client is connecting, this
code checks to see whether it has an argument that is equal to
argument, the
Sum
respond with the appropriate method:
application.onConnect = function(clientObj){
if(arg1 == "svr1"){
clientObj.Sum = function(p1, p2){
return p1 + p2;
}
}
return true;
};
The following example uses an AMF request to make a call to an application server. This allows
Flash Communication Server to connect to an application server and then invoke the
method. The Java adaptor dispatches the call by using the identifier to the left of the dot as the
class name and the identifier to the right of the dot as a method of the class.
nc = new NetConnection;
nc.connect("http://www.xyz.com/java");
nc.call("myPackage.quote", newResult());

NetConnection.close

Availability
Flash Communication Server MX.
Usage
myNetConnection.close()
Parameters
None.
Returns
Nothing.
Description
Method; closes the connection with the server. After you close the connection, you can reuse the
NetConnection instance and reconnect to an old application or connect to a new one.
Note: The NetConnection.close method has no effect on HTTP connections.
NetConnection.call
on server 2:
Sum
method is defined so that when the method is called from svr1, svr2 can
NetConnection.call
method on the client: it invokes a
Client.call
method.
. If the client has that
svr1
Server-Side Communication ActionScript
method on the
quote
37

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH COMMUNICATION SERVER MX-SERVER-SIDE COMMUNICATION ACTIONSCRIPT DICTIONARY and is the answer not in the manual?

This manual is also suitable for:

Flash communication server mx

Table of Contents