Example
This example shows a CheckBox component with methods that set the label or value of each
check box instance:
myCheckBox1.setValue(true);
myCheckBox1.setLabel("new label");
...
It's convenient to think of the value and label of a check box as properties. It's possible to use
Object.watch()
method invocation, as in the following:
// Define constructor for (and thus define) CheckBox class
function CheckBox() {
...
this.watch('value', function (id, oldval, newval){
...
});
this.watch('label', function(id, oldval, newval){
...
});
}
When the value or label property is modified, the function specified by the component is invoked
to perform any tasks needed to update the appearance and state of the component. The following
example invokes an
changed, causing the component to update its graphical representation.
myCheckBox1.value = false;
This syntax is more concise than the former syntax:
myCheckBox1.setValue(false);
See also
Object.addProperty(),
Object()
Availability
Flash Player 5 .
Usage
Object( [ value ] )
Parameters
A number, string, or Boolean value.
value
Returns
An object.
Description
Conversion function; creates a new, empty object or converts the specified number, string, or
Boolean value to an object. This command is equivalent to creating an object using the Object
constructor (see
582
Chapter 12: ActionScript Dictionary
to make accessing the value and label look like property access rather than
method to notify the component that the variable has
Object.watch()
Object.unwatch()
"Constructor for the Object class" on page
575).
Need help?
Do you have a question about the FLASH MX 2004 - ACTIONSCRIPT and is the answer not in the manual?
Questions and answers