Example
The following example defines a
After the application connects, the
objects of type
Color
called to create the server-side object. After the application stops, the
is called again and passes the value
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
property:
prototype
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);
40
Server-Side ActionScript Language Reference
constructor function with properties and methods.
Color
registerClass
. When a typed object is sent from the client to the server, this class is
to unregister the class.
null
method is called to register a class for the
application.registerClass
method
registerClass
method with the
Need help?
Do you have a question about the FLASH MEDIA SERVER 2-SERVER-SIDE ACTIONSCRIPT LANGUAGE and is the answer not in the manual?