valueOf (String.valueOf method)

public valueOf() : String

Returns the primitive value of a String instance. This method is designed to convert a String object into a primitive string value. Because Flash Player automatically calls valueOf() when necessary, you rarely need to explicitly call this method.

Availability: ActionScript 1.0; Flash Player 5

Returns

String - The value of the string.

Example

The following example creates a new instance of the String class and then shows that the valueOf method returns the primitive value, rather than a reference to the new instance.

var str:String = new String("Hello World");
var value:String = str.valueOf();
trace(str instanceof String); // true
trace(value instanceof String); // false
trace(str === value); // false

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/00002173.html