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.

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

trace("lowerCase: " + lowerCase); // output: lowerCase: 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 />

toUpperCase (String.toUpperCase method)<br />

toString (String.toString method)<br />

public toString() : String<br />

Returns an object's properties as strings regardless of whether the properties are strings.<br />

Returns<br />

String - The string.<br />

Example<br />

The following example outputs an uppercase string that lists all of an object's properties<br />

(regardless of whether the properties are strings):<br />

var employee:Object = new Object();<br />

employee.name = "bob";<br />

employee.salary = 60000;<br />

employee.id = 284759021;<br />

var employeeData:String = new String();<br />

for (prop in employee)<br />

{<br />

employeeData += employee[prop].toString().toUpperCase() + " ";<br />

}<br />

trace(employeeData);<br />

If the toString() method were not included in this code (<strong>and</strong> the line within the for loop<br />

used employee[prop].toUpperCase()), the output would be "undefined undefined<br />

BOB". By including the toString() method, the desired output is produced: "284759021<br />

60000 BOB".<br />

toUpperCase (String.toUpperCase method)<br />

public toUpperCase() : String<br />

604 ActionScript classes

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

Saved successfully!

Ooh no, something went wrong!