MACROMEDIA FLASH MEDIA SERVER 2-SERVER-SIDE ACTIONSCRIPT LANGUAGE Reference page 39

Server-side actionscript language reference
Table of Contents

Advertisement

Returns
Nothing.
Description
Method; registers a constructor function that is used when deserializing an object of a certain
class type. If the constructor for a class is not registered, you cannot call the deserialized
object's methods. This method is also used to unregister the constructor for a class. This is an
advanced use of the server and is necessary only when sending ActionScript objects between a
client and a server.
The client and the server communicate over a network connection. Therefore, if you use
typed objects, each side must have the prototype of the same objects they both use. In other
words, both the client-side and server-side ActionScript must define and declare the types of
data they share so that there is a clear, reciprocal relationship between an object, method, or
property on the client and the corresponding element on the server. You can use
application.registerClass
can use the methods defined in the class.
Constructor functions should be used to initialize properties and methods; they should not be
used for executing server code. Constructor functions are called automatically when messages
are received from the client and need to be "safe" in case they are executed by a malicious
client. You shouldn't define procedures that could result in negative situations such as filling
up the hard disk or consuming the processor.
The constructor function is called before the object's properties are set. A class can define an
method, which is called after the object has been initialized with all its
onInitialize
properties. You can use this method to process data after an object is deserialized.
If you register a class that has its prototype set to another class, you must set the prototype
constructor back to the original class after setting the prototype. The second example below
illustrates this point.
Client-side classes must be defined as
following examples. If not defined in the correct way,
properly identify the class when its instance passes from the client to the server, and an
error will be returned.
to register the object's class type on the server side so that you
function function_name(){}
, as shown in the
application.registerClass
Application class
will not
39

Advertisement

Table of Contents
loading
Need help?

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?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash media server 2

Table of Contents