
Note: This article was created based on Flex 2. Minor changes in the description and code may be necessary before it can be applied to Flex 3.
Back in the very early days of the web, the world was a very static place. Sure, you could find information about a college student's cat—and some web pages even contained animated GIFs that let everyone know you were on the cutting edge of technology—but overall the information was static. When it was time to update information on your cat, Fluffy, you changed the source code for your web page and uploaded it to the server.
It didn't take long for people to realize that static content is rather boring; they craved the dynamic. Where websites once existed, Internet applications emerged, user experiences became important, and clients and servers exchanged XML data as commonly as GIFs once blinked next to Fluffy's name. The world changed, technology changed, and—when the timing was right—Flex 2 was born.
While admittedly a bit less dramatic than the evolution described above, this article is also about a transition from static to dynamic. A transition from using the powerful new XML processing features, E4X (ECMAScript for XML) of Flex 2 in a hard-coded static way to using them in a dynamic way based on user input, database queries, messages, or a variety of other sources limited only by the developer's imagination and a desire to provide the latest, greatest information on Fluffy.
To complete this tutorial you will need to install the following software and files:
Special thanks go to Alex Harui from Adobe Systems for allowing me access to his pet project, which eventually turned into this article.
Michael Labriola is a founding partner and senior consultant at Digital Primates IT Consulting Group. He has been developing Internet applications since 1995 and has been working with Flex since its 1.0 beta program. He specializes in developing applications with high business impact using emerging technologies.