-
Book Overview & Buying
-
Table Of Contents
ActionScript Graphing Cookbook
In this recipe, we will demonstrate how to embed the CSV file shown in the previous recipe, how to read and parse the data in that file, and ultimately how to display the data in the file.
Create a new project for this chapter and place the three datafiles from the previous recipe in the lib folder of the project (data.csv, data.xlsx and data.xml). Copy the Graph and Legend classes from the previous chapter into the src folder. We will be using those again.
If you didn't complete the chapter, you can just start from the example project supplied with the book.
To avoid excessive code, we will also use the StringHelper class from the Adobe ActionScript live docs that can be found at http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/String.html#includeExamplesSummary. Create a class called StringHelper in the src folder and copy the code into it.
Now create a new Recipe1 class in the src folder of your project:
package
{
import flash.display...
Change the font size
Change margin width
Change background colour