MACROMEDIA FLASH MEDIA SERVER 2-CLIENT-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR FLASH MEDIA SERVER 2 Manuel d'utilisateur Page 102

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 172
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 101
99
SERVER-SIDE ACTIONSCRIPT LANGUAGE REFERENCE FOR ADOBE MEDIA SERVER 5.0.1
Server-Side ActionScript Language Reference
Last updated 7/2/2013
p1, ..., pN Optional parameters that can be of any ActionScript type, including a reference to another ActionScript
object. These parameters are passed to the
methodName parameter when the method is executed on the remote
application server.
Returns
For RTMP connections, returns a boolean value of true if a call to methodName is sent to the client; otherwise, false.
For application server connections, it always returns
true.
Example
The following example uses RTMP to execute a call from one Adobe Media Server to another Adobe Media Server.
The code makes a connection to the App1 application on server 2 and then invokes the
Sum() method on server 2:
nc1.connect("rtmp://server2.mydomain.com/App1", "svr2",);
nc1.call("Sum", new Result(), 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 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 Adobe 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])
Vue de la page 101
1 2 ... 97 98 99 100 101 102 103 104 105 106 107 ... 171 172

Commentaires sur ces manuels

Pas de commentaire