Constructor for the Object class
Availability
Flash Player 5.
Usage
new Object([value])
Parameters
A number, Boolean value, or string to be converted to an object. This parameter
value
is optional. If you do not specify
defined properties.
Returns
Nothing.
Description
Constructor; creates a new Object object.
Object.addProperty()
Availability
Flash Player 6. In external class files, you can use
Usage
myObject.addProperty(prop, getFunc, setFunc)
Parameters
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
Returns a value of
Description
Method; creates a getter/setter property. When Flash reads a getter/setter property, it invokes the
get function and the function's return value becomes a value of
setter property, it invokes the set function and passes it the new value as a parameter. If a 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
, the constructor creates a new object with no
value
null
if the property is successfully created; otherwise, returns
true
is assigned by the statement
x
or
instead of this method.
get
set
for this parameter, the property is read-only.
prop
, the set function is passed the parameter
x = 1
.
false
. When Flash writes a getter/
Object.addProperty()
575
Need help?
Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?