![MACROMEDIA FLASH MX 2004 - ACTIONSCRIPT Reference Manual Download Page 582](http://html1.mh-extra.com/html/macromedia/flash-mx-2004-actionscript/flash-mx-2004-actionscript_reference-manual_3378897582.webp)
582
Chapter 12: ActionScript Dictionary
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()
to make accessing the value and label look like property access rather than
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
Object.watch()
method to notify the component that the variable has
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.unwatch()
Object()
Availability
Flash Player 5 .
Usage
Object( [
value
] )
Parameters
value
A number, string, or Boolean 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
“Constructor for the Object class” on page 575
).
Summary of Contents for FLASH MX 2004 - ACTIONSCRIPT
Page 1: ...ActionScript Reference Guide...
Page 8: ...8 Contents...
Page 12: ......
Page 24: ...24 Chapter 1 What s New in Flash MX 2004 ActionScript...
Page 54: ...54 Chapter 2 ActionScript Basics...
Page 80: ...80 Chapter 3 Writing and Debugging Scripts...
Page 82: ......
Page 110: ...110 Chapter 5 Creating Interaction with ActionScript...
Page 112: ......
Page 120: ...120 Chapter 6 Using the Built In Classes...
Page 176: ......
Page 192: ...192 Chapter 10 Working with External Data...
Page 202: ...202 Chapter 11 Working with External Media...
Page 204: ......
Page 782: ...782 Chapter 12 ActionScript Dictionary...
Page 793: ...Other keys 793 221 222 Key Key code...
Page 794: ...794 Appendix C Keyboard Keys and Key Code Values...
Page 798: ...798 Appendix D Writing Scripts for Earlier Versions of Flash Player...
Page 806: ...806 Appendix E Object Oriented Programming with ActionScript 1...
Page 816: ...816 Index...