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 />

Working with strings<br />

The ASCII art version of the graphic is shown on the right.<br />

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

ASCIIArt application files can be found in the folder Samples/AsciiArt. The application consists of the following files:<br />

File Description<br />

AsciiArtApp.mxml<br />

or<br />

AsciiArtApp.fla<br />

Extracting tab-delimited values<br />

Flash Player 9 and later, Adobe AIR 1.0 and later<br />

This example uses the common practice of storing application data separate from the application itself; that way, if the<br />

data changes (for example, if another image is added or an image’s title changes), there is no need to recreate the SWF<br />

file. In this case, the image metadata, including the image title, the URL of the actual image file, and some values that<br />

are used to manipulate the image, are stored in a text file (the txt/ImageData.txt file in the project). The cont<strong>en</strong>ts of the<br />

text file are as follows:<br />

Last updated 6/6/2012<br />

The main application file in Flash (FLA) or Flex (MXML)<br />

com/example/programmingas3/asciiArt/AsciiArtBuilder.as The class that provides the main functionality of the<br />

application, including extracting image metadata from a text<br />

file, loading the images, and managing the image-to-text<br />

conversion process.<br />

com/example/programmingas3/asciiArt/BitmapToAsciiConverter.as A class that provides the parseBitmapData() method for<br />

converting image data into a String version.<br />

com/example/programmingas3/asciiArt/Image.as A class which repres<strong>en</strong>ts a loaded bitmap image.<br />

com/example/programmingas3/asciiArt/ImageInfo.as A class repres<strong>en</strong>ting metadata for an ASCII art image (such as<br />

title, image file URL, and so on).<br />

image/ A folder containing images used by the application.<br />

txt/ImageData.txt A tab-delimited text file, containing information on the<br />

images to be loaded by the application.<br />

20

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

Saved successfully!

Ooh no, something went wrong!