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

Preparing the data

A relational network represents hierarchy and linkage between objects and a good data structure, such as the tree data structure. This recipe is going to show how to parse the data for it to be ready to generate a relational network.

Getting ready

Open the files downloaded from the Packt Publishing website for Chapter 8 | Recipe 1 to follow along.

How to do it...

The following steps will show you how to parse the data for a relational network:

  1. Create the data in an XML file similar to Data.xml. The following is what one entry looks like:
    <node name="NODE NAME" color="0x0000ff"></node>
  2. In Main.as, add the embed code to attach the data to our project:
    [Embed(source = "/Data.xml", mimeType="application/octet-stream")] private var XmlData:Class; ...

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