Helping the World with KnowledgePosts RSS Comments RSS

Archive for the Tag 'flash application'

Flash Graph Application

  • Actionscript 2
  • Flash 8
  • Open source
  • Demo below

Grapher is a flash graph application programmed with actionscript 2.0 in OOP. The basic version 1.0 allows you adjust the axis and plot points in the class <world.as>. There is not much you can control with the output now except to mouse over the points to show the coordinates and drag them to move the points around.

I have a few features in mind - such as calculating the angles, areas and distances between points making it more useful for those who are learning geometry. And I could also add a GUI to add, remove and join points.

Demo:

Drag the points around.

There are currently 3 classes:

  1. world.as - Which in the stage contains everything except the background. It controls the axis and adds and stores the points and lines. There is a tick() function which executes every frame (24 FPS) in every iteration it loops through the points and executes each point’s tick().
  2. point.as - This is the class of the point movie clip. The constructor function creates all the interaction function with the user’s mouse such as dragging and the pop up tooltip when user rolls over it. This class also draws the line, but stores as a child of world.as’s line container movie clip. The line is drawn to the previous point by calculating the relative coordinate from this point to the previous.
  3. Tooltip.as - Is a modified class taken from http://theflashblog.com/?p=16. I added the function update_text(theText) in order to update the text on the tool tip. This is because by giving the user the ability to move the point, the text must be updated.

Within the point class’s tick() function, there are 3 functions that run every iteration, the update_tooltip() which updates the text in the tooltip, the update_line() which redraws the line and the update_text() which updates the coordinates (It is hidden by line 41 in the point class, you can un-hide it by commenting out that line.

Download:

  • Download >> Flash Grapher (Downloaded 172 times)
  • Open source, have fun with it and link back if you can.

2 responses so far