MACROMEDIA FLASH MEDIA SERVER 2-SERVER MANAGEMENT ACTIONSCRIPT LANGUAGE Bedienungsanleitung Seite 30

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 155
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 29
ADOBE FLASH MEDIA INTERACTIVE SERVER
Server-Side ActionScript Language Reference
27
Example
The following 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();
// Set constructor back to that of B.
B.prototype.constructor = B;
// Insert code here.
application.registerClass("B", B);
application.registerProxy()
application.registerProxy(methodName, proxyConnection [, proxyMethodName])
Maps a method call to another function. You can use this method to communicate between different application
instances that can be on the same Flash Media Server or on different Flash Media Servers. Clients can execute server-
side methods of any application instances to which they are connected. Server-side scripts can use this method to
register methods to be proxied to other application instances on the same server or a different server. You can remove
or unregister the proxy by calling this method and passing
null for the proxyConnection parameter, which results
in the same behavior as never registering the method at all.
Seitenansicht 29
1 2 ... 25 26 27 28 29 30 31 32 33 34 35 ... 154 155

Kommentare zu diesen Handbüchern

Keine Kommentare