MACROMEDIA FLASH COMMUNICATION SERVER MX-SERVER-SIDE COMMUNICATION ACTIONSCRIPT DICTIONARY Spécifications Page 329

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 369
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 328
Server-Side Communication ActionScript 29
The sum method can then be called from NetConnection.call on the Flash client side, as shown
in the following example:
nc = new NetConnection();
nc.connect("rtmp://myServer/myApp");
nc.call("sum", new result.sum(), 20, 50);
function result.sum(){
this.onResult = function (retVal){
output += "sum is " + retVal;
};
this.onStatus = function(errorVal){
output += errorVal.code + " error occurred";
};
}
The sum method can also be called on the server side, as shown here:
newClient.sum();
The following example creates two functions that you can call from either a client-side or server-
side script:
application.onConnect = function(clientObj) {
// Add a callable function called "foo"; foo returns the number 8
clientObj.foo = function() {return 8;};
// Add a remote function that is not defined in the onConnect call
clientObj.bar = application.barFunction;
};
// The bar function adds the two values it is given
application.barFunction = function(v1,v2) {
return (v1 + v2);
};
You can call either of the two functions that were defined in the previous examples (foo and bar)
by using the following code in a client-side script:
c = new NetConnection();
c.call("foo");
c.call("bar", null, 1, 1);
You can call either of the two functions that were defined in the previous examples (foo and bar)
by using the following code in a server-side script:
c = new NetConnection();
c.onStatus = function(info) {
if(info.code == "NetConnection.Connect.Success") {
c.call("foo");
c.call("bar", null, 2, 2);
}
};
Client.getBandwidthLimit
Availability
Flash Communication Server MX.
Usage
Client.getBandwidthLimit(iDirection)
Parameters
iDirection An integer specifying the connection direction: 0 indicates a client-to-server
direction, 1 indicates a server-to-client direction.
Vue de la page 328
1 2 ... 324 325 326 327 328 329 330 331 332 333 334 ... 368 369

Commentaires sur ces manuels

Pas de commentaire