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

Creating the visual for a node

In this recipe, we will create the building block for our relational network: the node. This is basically a circle with a label in the middle. If it is not the center node (the parent), then it will also display how many children it has.

Creating the visual for a node

Getting ready

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

How to do it...

The following are the steps required to do the visuals for a node:

  1. Create the NodeVisual.as class where everything will happen.
  2. Add in the constructor code to draw the under circle and the gradient circle:
    _underCircle = new Shape(); _underCircle.graphics.beginFill(0xffffff); ...

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