MACROMEDIA FLASH COMMUNICATION SERVER MX-SERVER-SIDE COMMUNICATION ACTIONSCRIPT DICTIONARY Manuel d'utilisateur Page 26

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 80
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 25
26
Example
This example defines a Color constructor function with properties and methods. After the
application connects, the
registerClass method is called to register a class for the objects of
type Color. When a typed object is sent from the client to the server, this class is called to create
the server-side object. After the application stops, the
registerClass method is called again and
passes the value
null to unregister the class.
function Color(){
this.red = 255;
this.green = 0;
this.blue = 0;
}
Color.prototype.getRed = function(){
return this.red;
}
Color.prototype.getGreen = function(){
return this.green;
}
Color.prototype.getBlue = function(){
return this.blue;
}
Color.prototype.setRed = function(value){
this.red = value;
}
Color.prototype.setGreen = function(value){
this.green = value;
}
Color.prototype.setBlue = function(value){
this.blue = value;
}
application.onAppStart = function(){
application.registerClass("Color", Color);
};
application.onAppStop = function(){
application.registerClass("Color", null);
};
The following example shows how to use the application.registerClass method with the
prototype property:
function A(){}
function B(){}
B.prototype = new A();
B.prototype.constructor = B; // set constructor back to that of B
// insert code here
application.registerClass("B", B);
Application.registerProxy
Availability
Flash Communication Server MX.
Usage
application.registerProxy(methodName, proxyConnection [, proxyMethodName])
Parameters
methodName The name of a method. All requests to execute methodName for this application
instance are forwarded to the
proxyConnection object.
Vue de la page 25
1 2 ... 21 22 23 24 25 26 27 28 29 30 31 ... 79 80

Commentaires sur ces manuels

Pas de commentaire