Valueof (String.valueof Method) - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

Example
The following example creates a string with all lowercase characters and then creates a copy of
that string using
toUpperCase()
var lowerCase:String = "lorem ipsum dolor";
var upperCase:String = lowerCase.toUpperCase();
trace("lowerCase: " + lowerCase); // output: lowerCase: lorem ipsum dolor
trace("upperCase: " + upperCase); // output: upperCase: LOREM IPSUM DOLOR
An example is also found in the Strings.fla file in the ActionScript samples folder. The
following list gives typical paths to this folder:
Windows: boot drive\Program Files\Macromedia\Flash 8\Samples and
Tutorials\Samples\ActionScript
Macintosh: Macintosh HD/Applications/Macromedia Flash 8/Samples and Tutorials/
Samples/ActionScript
See also
toLowerCase (String.toLowerCase method)

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
necessary, you rarely need to explicitly call this method.
Availability: ActionScript 1.0; Flash Player 5
Returns
- The value of the string.
String
Example
The following example creates a new instance of the String class and then shows that the
method returns the primitive value, rather than a reference to the new instance.
valueOf
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
:
when
valueOf()
String
1141

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF