Returns
A reference to an Object object.
Description
Constructor; creates an Object object and stores a reference to the object's constructor method in
the object's
constructor
Example
The following example creates a generic object named myObject:
var myObject:Object = new Object();
Object.addProperty()
Availability
Flash Player 6. In ActionScript 2.0 classes, you can use
Usage
myObject.addProperty(prop:String, getFunc:Function, setFunc:Function) :
Boolean
Parameters
A string; the name of the object property to create.
prop
The function that is invoked to retrieve the value of the property; this parameter is a
getFunc
Function object.
The function that is invoked to set the value of the property; this parameter is a
setFunc
Function object. If you pass the value
Returns
A Boolean value:
Description
Method; creates a getter/setter property. When Flash reads a getter/setter property, it invokes the
function, and the function's return value becomes the value of
get
getter/setter property, it invokes the
property with the given name already exists, the new property overwrites it.
A "get" function is a function with no parameters. Its return value can be of any type. Its type can
change between invocations. The return value is treated as the current value of the property.
A "set" function is a function that takes one parameter, which is the new value of the property. For
example, if property
of type number. The return value of the set function is ignored.
1
property.
null
if the property is successfully created;
true
set
is assigned by the statement
x
or
get
set
for this parameter, the property is read-only.
false
function and passes it the new value as a parameter. If a
, the set function is passed the parameter
x = 1
instead of this method.
otherwise.
. When Flash writes a
prop
Object.addProperty()
377
Need help?
Do you have a question about the FLEX-FLEX ACTIONSCRIPT LANGUAGE and is the answer not in the manual?