String function

String(expression:Object) : String

Returns a string representation of the specified parameter, as described in the following list:

If expression is undefined, the return values are as follows:

Note: Slash notation is not supported by ActionScript 2.0.

Availability: ActionScript 1.0; Flash Player 4 - Behavior changed in Flash Player 7.

Parameters

expression:Object - An expression to convert to a string.

Returns

String - A string.

Example

In the following example, you use ActionScript to convert specified expressions to a string:

var string1:String = String("3");
var string2:String = String("9");
trace(string1+string2); // output: 39

Because both parameters are strings, the values are concatenated rather than added.

See also

toString (Number.toString method), toString (Object.toString method), String, " string delimiter operator


Version 8

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/8/main/00001773.html