In this recipe, we'll rewrite the embedded recipe so it can read XML files. ActionScript 3.0 has very thorough support for the XML format, so you may notice that this recipe is the easiest one of the entire chapter.
Because so much data, these days, is transmitted in XML or variants such as RSS, it may also prove to be the most useful.
Create a Recipe4
document
class and have it extend Sprite
. Set up the Graph
class as in the previous recipes:
package { import flash.display.Sprite; public class Recipe4 extends Sprite { private var graph:Graph; public function Recipe4() { graph = new Graph( -50, 550, 750, -50); addChild(graph); graph.drawHorizontalAxis(0, 0, 700, 50, ["0", "700"]); graph.drawVerticalAxis(0, 0, 500, 50, ["0", "250", "500"]); } } }