User Guide
Example: ASCII Art 221
The ASCIIArt application files can be found in the folder Samples/AsciiArt. The application
consists of the following files:
Extracting tab-delimited values
This example uses the common practice of storing application data separate from the
application itself; that way, if the data changes (for example, if another image is added or an
image’s title changes), there is no need to recreate the SWF file. In this case, the image
metadata, including the image title, the URL of the actual image file, and some values that are
used to manipulate the image, are stored in a text file (the txt/ImageData.txt file in the
project). The contents of the text file are as follows:
FILENAMETITLEWHITE_THRESHHOLDBLACK_THRESHHOLD
FruitBasket.jpgPear, apple, orange, and bananad810
Banana.jpgA picture of a bananaC820
Orange.jpgorangeFF20
Apple.jpgpicture of an apple6E10
File Description
AsciiArtApp.mxml The user interface for the application in MXML
for Flex.
com/example/programmingas3/asciiArt/
AsciiArtBuilder.as
The class that provides the main functionality of
the application, including extracting image
metadata from a text file, loading the images,
and managing the image-to-text conversion
process.
com/example/programmingas3/asciiArt/
BitmapToAsciiConverter.as
A class that provides the
parseBitmapData()
method for converting image data into a String
version.
com/example/programmingas3/asciiArt/
Image.as
A class which represents a loaded bitmap
image.
com/example/programmingas3/asciiArt/
ImageInfo.as
A class representing metadata for an ASCII art
image (such as title, image file URL, and so on).
image/ A folder containing images used by the
application.
txt/ImageData.txt A tab-delimited text file, containing information
on the images to be loaded by the application.