O'Reilly logo

ActionScript Graphing Cookbook by Peter Backx, Dominic Gélineau

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Loading data with XML

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.

Getting ready

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, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required