EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Valueof (Object.valueof Method)

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
1006 ActionScript classes
Parameters
name:String - A string; the name of the object property that should no longer be watched.
Returns
Boolean - A Boolean value: true if the watchpoint is successfully removed, false otherwise.
Example
See the example for
Object.watch().
See also
watch (Object.watch method), addProperty (Object.addProperty method)
valueOf (Object.valueOf method)
public valueOf() : Object
Returns the primitive value of the specified object. If the object does not have a primitive
value, the object is returned.
Availability: ActionScript 1.0; Flash Player 5
Returns
Object - The primitive value of the specified object or the object itself.
Example
The following example shows the return value of valueOf() for a generic object (which does
not have a primitive value) and compares it to the return value of toString(). First, create a
generic object. Second, create a new Date object set to February 1, 2004, 8:15 AM. The
toString() method returns the current time in human-readable form. The valueOf() method
returns the primitive value in milliseconds. Third, create a new Array object containing two
simple elements. Both toString() and valueOf() return the same value: one,two:
// Create a generic object
var myObject:Object = new Object();
trace(myObject.valueOf()); // output: [object Object]
trace(myObject.toString()); // output: [object Object]
The following examples show the return values for the built-in classes Date and Array, and
compares them to the return values of
Object.toString():
// Create a new Date object set to February 1, 2004, 8:15 AM
// The toString() method returns the current time in human-readable form
// The valueOf() method returns the primitive value in milliseconds
var myDate:Date = new Date(2004,01,01,8,15);
trace(myDate.toString()); // output: Sun Feb 1 08:15:00 GMT-0800 2004

Table of Contents

Related product manuals