Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Build a Better Charting Engine Using Flash and XML : Page 3

When you need to display data as charts in a Web app, forget about precompiled DLLs, assemblies, and expensive third-party components. This article will teach you how to use Flash MX to take data from any server-side script and render it in sleek-looking, animated charts.


advertisement
The Chart Scene's Layers
  • Global Functions and Constants: This layer contains the global functions and constants to be used generally throughout the chart. Open up the Actions Panel for the keyframe on this layer and you'll see the same code as in Listing 1.

    All the ActionScript contained in this frame belong to six functions. Click on each function for an overview:

  • Actions: All the Actions defined in this article are contained in the Actions Layer. This layer also contains all of the ActionScript required for building the chart.


  • Figure 4. The Labels Layer: This layer consists of four blank keyframes that contain their own names.

  • Labels: This layer consists of four blank keyframes that contain their own names (Figure 4). When you design a Flash application, it's a good idea to name all the keyframes on a layer to simplify ActionScript navigation.
  • Column: This layer is used to manipulate the shapes of the data once it's rendered.
  • Rendering Chart Message: This layer shows a rendering chart message while the XML doxument is being parsed and the various co-ordinates of the chart elements are calculated. Instead of a plain textbox, you can also use animated graphic sequences or something more pertinent to your Website's theme.
  • XML Error Message: The layer is invoked when there is an error in the XML document supplied by the server. It displays the appropriate error message and stops the play of the movie. Again, you can customize this layer with your own graphics, animation, etc.



Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date