MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference page 552

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

If invoked incorrectly,
describes errors that can occur:
Error condition
is not a valid property name; for example,
name
an empty string.
is not a valid function object.
getter
is not a valid function object.
setter
Availability: ActionScript 1.0; Flash Lite 2.0 - In ActionScript 2.0 classes, you can use get or
set instead of this method.
Parameters
- A string; the name of the object property to create.
name:String
- The function that is invoked to retrieve the value of the property; this
getter:Function
parameter is a Function object.
- The function that is invoked to set the value of the property; this
setter:Function
parameter is a Function object. If you pass the value
read-only.
Returns
- A Boolean value:
Boolean
Example
In the following example, an object has two internal methods,
. A property,
getQuantity()
either set or retrieved. A third internal method,
associated with the property
, the ActionScript interpreter automatically invokes
myBook.bookcount
myBook.getQuantity()
interpreter invokes
myObject.setQuantity()
function, so attempts to modify
set
552
ActionScript classes
Object.addProperty()
if the property is successfully created;
true
, can be used to invoke these methods when it is
bookcount
. When a script retrieves the value of
bookname
. When a script modifies the value of
bookname
can fail with an error. The following table
What happens
Returns
and the property is not added.
false
Returns
and the property is not added.
false
Returns
and the property is not added.
false
for this parameter, the property is
null
setQuantity()
, returns a read-only value that is
getTitle()
myBook.bookcount
. The
property does not specify a
bookname
are ignored.
otherwise.
false
and
, the

Advertisement

Table of Contents
loading

Table of Contents