13.08.2012 Views

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

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.

<strong>ACTIONSCRIPT</strong> 3.0 DEVELOPER’S GUIDE<br />

Internationalizing applications<br />

var phrase:String = "Schloß Neuschwanstein";<br />

var converter:StringTools = new StringTools("de-DE");<br />

var upperPhrase:String = converter.toUpperCase(phrase);<br />

trace(upperPhrase); // SCHLOSS NEUSCHWANSTEIN<br />

var lowerPhrase:String = converter.toLowerCase(upperPhrase);<br />

trace(lowerPhrase);// schloss neuschwanstein<br />

The toUpperCase() method transforms the lowercase letter “ß” into the uppercase letters “SS”. This transformation<br />

works only in one direction. Wh<strong>en</strong> the letters “SS” are transformed back to lowercase, the result is “ss” not “ß”.<br />

Example: Internationalizing a stock ticker application<br />

Flash Player 10.1 and later, Adobe AIR 2.0 and later<br />

The Global Stock Ticker application retrieves and displays fictitious data about stocks in three differ<strong>en</strong>t stock markets:<br />

the United States, Japan, and Europe. It formats the data according to the conv<strong>en</strong>tions of various locales.<br />

This example illustrates the following features of the flash.globalization package:<br />

Locale-aware number formatting<br />

Locale-aware curr<strong>en</strong>cy formatting<br />

Setting curr<strong>en</strong>cy ISO code and curr<strong>en</strong>cy symbols<br />

Locale-aware date formatting<br />

Retrieving and displaying appropriate month name abbreviations<br />

To get the application files for this sample, see www.adobe.com/go/learn_programmingAS3samples_flash. The Global<br />

Stock Ticker application files can be found in the folder Samples/GlobalStockTicker. The application consists of the<br />

following files:<br />

File Description<br />

GlobalStockTicker.mxm<br />

l<br />

or<br />

GlobalStockTicker.fla<br />

The user interface for the application for Flex (MXML) or Flash (FLA).<br />

styles.css Styles for the application user interface (Flex only).<br />

com/example/program<br />

mingas3/stockticker/fle<br />

x/FinGraph.mxml<br />

com/example/program<br />

mingas3/stockticker/fla<br />

sh/GlobalStockTicker.as<br />

comp/example/progra<br />

mmingas3/stockticker/f<br />

lash/RightAlignedColu<br />

mn.as<br />

An MXML compon<strong>en</strong>t that displays a chart of simulated stock data, for Flex only.<br />

Docum<strong>en</strong>t class containing the user interface logic for the application (Flash only).<br />

A custom cell r<strong>en</strong>derer for the Flash DataGrid compon<strong>en</strong>t (Flash only).<br />

Last updated 6/6/2012<br />

951

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

Saved successfully!

Ooh no, something went wrong!