Flash CS3 Documentation |
|||
| Programming ActionScript 3.0 > Working with strings > Obtaining string representations of other objects | |||
You can obtain a String representation for any kind of object. All objects have a toString() method for this purpose:
var n:Number = 99.47;
var str:String = n.toString();
// str == "99.47"
When using the + concatenation operator with a combination of String objects and objects that are not strings, you do not need to use the toString() method. For details on concatenation, see the next section.
The String() global function returns the same value for a given object as the value returned by the object calling the toString() method.
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00000082.html