03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Returns a copy of the String object, with all lowercase characters converted to uppercase. The<br />

original value is unchanged.<br />

Returns<br />

String - A string.<br />

Example<br />

The following example creates a string with all lowercase characters <strong>and</strong> then creates a copy of<br />

that string using toUpperCase():<br />

var lowerCase:String = "lorem ipsum dolor";<br />

var upperCase:String = lowerCase.toUpperCase();<br />

trace("lowerCase: " + lowerCase); // output: lowerCase: lorem ipsum dolor<br />

trace("upperCase: " + upperCase); // output: upperCase: LOREM IPSUM DOLOR<br />

An example is also in the Strings.fla file in the ActionScript samples folder at<br />

www.adobe.com/go/learn_fl_samples. Download <strong>and</strong> decompress the .zip file <strong>and</strong> navigate to<br />

the folder for your version of ActionScript to access the sample.<br />

See also<br />

toLowerCase (String.toLowerCase method)<br />

valueOf (String.valueOf method)<br />

public valueOf() : String<br />

Returns the string.<br />

Returns<br />

String - The value of the string.<br />

Example<br />

The following example creates a new instance of the String object <strong>and</strong> then shows that the<br />

valueOf method returns a reference to the primitive value, rather than an instance of the<br />

object.<br />

var str:String = new String("Hello World");<br />

var value:String = str.valueOf();<br />

trace(str instanceof String); // true<br />

trace(value instanceof String); // false<br />

trace(str === value); // false<br />

String 605

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!