String( ) Global Function

ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By Colin Moock
Chapter 18.  ActionScript Language Reference
String( ) Global Function Flash 5

convert a value to the string datatype
String(value)

Arguments

value

An expression containing the value to be converted to a string.

Returns

The result of converting value to a primitive string.

Description

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.

Usage

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.

See Also

The String class; "Explicit Type Conversion," in Chapter 3



    ActionScript for Flash MX. The Definitive Guide
    ActionScript for Flash MX: The Definitive Guide, Second Edition
    ISBN: 059600396X
    EAN: 2147483647
    Year: 2002
    Pages: 780
    Authors: Colin Moock

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net