MACROMEDIA FLASH MEDIA SERVER 2-SERVER MANAGEMENT ACTIONSCRIPT LANGUAGE Manuale Utente Pagina 74

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 155
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 73
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
71
The following Server-Side ActionScript code is on server 2. When the client is connecting, this code checks to see
whether it has a parameter that is equal to
svr1. If the client has that parameter, the Sum() method is defined so that
when the method is called from svr1, svr2 can 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 Action Message Format (AMF) request to make a call to an application server. This
allows Flash Media Server to connect to an application server and then invoke the
quote() 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", new Result());
NetConnection.close()
nc.close()
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.
Availability
Flash Communication Server 1
NetConnection.connect()
nc.connect(URI, [p1, ..., pN])
Connects to another Flash Media Server or to a Flash Remoting server such as Adobe ColdFusion.
Call
NetConnection.connect() to connect to an application server running a Flash Remoting gateway over HTTP
or to connect to another Flash Media Server for sharing audio, video, and data over one of the following versions of
RTMP:
It is good practice to write an
application.onStatus() callback function and check the
NetConnection.isConnected property for RTMP connections to see whether a successful connection was made.
For Action Message Format (AMF) connections, check
NetConnection.onStatus().
Availability
Flash Communication Server 1
Protocol Description
RTMP Real-Time Messaging Protocol
RTMPS Real-Time Messaging Protocol over SSL
Vedere la pagina 73
1 2 ... 69 70 71 72 73 74 75 76 77 78 79 ... 154 155

Commenti su questo manuale

Nessun commento