Accessibility

Flash Article

 

Macromedia XML News Aggregator Web Service Sample Application and Source File


Mike Chambers

Mike Chambers

Adobe

Created:
29 March 2004
User Level:
Advanced

The Macromedia XML News Aggregator (MXNA) Web Service Application is a sample application built in Flash MX Professional 2004. It uses the MXNA web service API to provide a simple interface for quickly viewing and reading weblog feeds and posts aggregated by the MXNA. Here is the application in action:

Get Macromedia Flash Player

Requirements

Macromedia Flash MX Professional 2004


Sample Files



MXNA ActionScript 2.0 Library

Level of Skill Required: Advanced

This tutorial assumes that you can analyze the sample code on your own, without a step-by-step guide.

The application is built using ActionScript 2.0 and the web services classes included with Flash MX Professional 2004. I’ve completely commented the source code for the application so you can easily dissect and learn from the application.

Here is some information to prepare you to work with the code.

Using the Web Services Classes

The application requires the web services classes included with Flash MX Professional 2004. To use these classes, you must manually include them within your library. The MXNA application’s library already contains the web services classes, however, for future reference, here are the steps to place it within your library:

  1. From within Flash MX Professional 2004 open Window > Other Panels > Common Libraries > Classes
  2. Drag the WebServicesClasses symbol from the library onto the Stage.
  3. Delete the WebServicesClasses symbol.

This places the class in your library, making it available for use at runtime.

Finding the ActionScript

When you open the application FLA file, you will notice that there is no ActionScript included within the FLA. All of the ActionScript for the application is held in external classes that are linked to symbols within the library.

To view the linkage and class for each symbol:

  1. Open the library for the application (Window > Library).
  2. Open the MXNAApp folder within the library. This contains all of the class symbols of the application.
  3. Right-click the MXNAApp\MXNAAppController symbol. This is the symbol that represents the controller for the application.
Linkage Properties dialog box for MXNAAppController symbol

Figure 1. Linkage Properties dialog box for MXNAAppController symbol

Notice the section titled AS 2.0 Class, which has a value of com.macromedia.mxna.app.MXNAAppController. This specifies that the symbol is associated with the specified class. (If you look in your file system, you can find the class in the com/macromedia/mxna.app/MXNAAppController.as file.)

Class layout in the file system

Figure 2. Class layout in the file system

As soon as the Flash Player loads the MXNAAppController symbol, it will also automatically load the MXNAAppController class and associate it with that symbol.

Additional Resources

About the author

Mike Chambers has spent the last eight years building applications that target the Flash runtime. During that time, he has worked with numerous technologies, including Flash, Generator, .NET, Central, Flex, and Ajax. He is currently the Principal Product Manager for developer relations for Adobe AIR. He has written and spoken extensively on Flash and rich Internet application development and is coauthor of the Apollo for Adobe Flex Developers Pocket Guide, Adobe Integrated Runtime (AIR) for JavaScript Developers Pocketguide, Flash Enabled: Flash Design and Development for Devices as well as Generator and Flash Demystified. Mike received his Masters in International Economics and European Studies from the John Hopkins School of Advanced International Studies (SAIS) in 1998. When he is not programming, Mike can be found playing Halo 2, trying to recover from his World of Warcraft addiction, or playing with his two daughters.