
String Class
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Alphabetical Language Reference
|
805
described in Table 3-2 in Chapter 3. Normally it’s not necessary to use the String() func-
tion; 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 “Flash 4–to–Flash 5 Datatype Conver-
sion” in Appendix C.
See Also
The String class; “Explicit Type Conversion,” in Chapter 3
String Class
wrapper class for string primitive type
Flash 5; performance enhanced in Flash 6
Constructor
new String(value)
Arguments
value An expression to be resolved and, if necessary, converted to a string, then
wrapped in a String object.
Properties
length The number of characters in a string.
Class Methods
The following method is invoked through the String class itself, not through an object of
the String class:
fromCharCode()
Generate a string from one or more ...