
Object.toString() Method
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
730
|
ActionScript Language Reference
// Retrieve our GamePlayer object.
p1 = gameData_so.data.player1;
// Check p1's score:
trace(p1.score);
// Add 50 points to p1's score. This works
// only because the GamePlayer class is registered.
p1.addPoints(50);
A similar workflow applies to objects sent over a network via LocalConnection and Flash
Remoting. For more information on Flash Remoting, see:
http://www.macromedia.com/software/flash/flashremoting/
See Also
#initclip, LocalConnection, MovieClip.attachMovie(), Object.__proto__, the SharedObject
object; Chapter 14
Object.toString() Method
the value of the object, as a string
Flash 5
someObject.toString()
Returns
An internally defined string that describes or otherwise represents the object.
Description
The toString() method returns a string description for someObject. The ECMA-262 specifi-
cation states that, by default, Object.toString() should return the expression:
"[object " + class + "]"
where class is the internally defined name of the class to which someObject belongs. In
practice, some ActionScript classes overwrite the default toString() method of Object in
order to provide more meaningful information about each instance of the class. For those
classes that don’t provide a custom toString() method, ActionScript does ...