Name
Object.valueOf( ) Method — the primitive value of the object
Availability
Flash 5
Synopsis
someObject.valueOf( )
Returns
The internally defined primitive value of
someObject, if a primitive value is
associated with someObject. If no
primitive value is associated with
someObject, then
someObject itself is returned.
Description
The valueOf( ) method returns the primitive
datum associated with an object, if such an association exists. This
method is mostly commonly used with objects of the
Number, String, and
Boolean classes, which all have associated
primitive data. The MovieClip.valueOf( ) method
returns a string representing the path to the clip.
Note that it’s rarely necessary to invoke valueOf(
) explicitly; it is automatically invoked by the
interpreter whenever someObject is used
where a primitive is expected.
See Also
Boolean.valueOf( ), MovieClip.valueOf(
), Number.valueOf( ),
Object.toString( ), String.valueOf(
)
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access