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:
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.
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:
This places the class in your library, making it available for use at runtime.
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:
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.)
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.
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.