String( ) Global Function | Flash 5 |
convert a value to the string datatype |
An expression containing the value to be converted to a string.
The result of converting value to a primitive string.
The String( ) function converts its argument to a primitive string value and returns that converted value. The results of converting various types of data to a primitive string are described in Table 3-2 in Chapter 3. Normally it's not necessary to use the String( ) function; ActionScript automatically converts values to the string type when appropriate.
Be sure not to confuse the String( ) global function with the String class constructor. The former converts an expression to a string, whereas the later is a class that wraps primitive string data in an object so that properties and methods can be applied to it.
Note that the String( ) function sometimes appears in Flash 4 .fla files that have been converted to a later Flash format. For information on how datatypes are handled when Flash 4 files are converted to Flash 5 or later, see Section C.3.4 in Appendix C.
The String class; "Explicit Type Conversion," in Chapter 3