-
Book Overview & Buying
-
Table Of Contents
ActionScript Graphing Cookbook
By :
This recipe looks at using the URLLoader class to load a CSV data file from the Internet. It's very similar to the previous recipe, but it gives you the ability to dynamically load files from the Internet. Thus you can update the files without needing to change the ActionScript program.
Make sure
you have a copy of the data.csv file somewhere on the Internet. If you don't have a site, you can use DropBox as described in the first recipe of this chapter. This recipe will use a link to my own DropBox folder, but it's much more instructive if you can use your own and change the data to see the effect.
Start by creating a copy of the previous Recipe1 class and name it Recipe2. This will be our basis.
In the following steps, we'll replace the embed code with code that will load the file from the Internet:
Remove the embed code and the DataClass property. We won't need these anymore.
Now move the parsing and function drawing code into...
Change the font size
Change margin width
Change background colour