Accessibility

Adobe AIR article

 

Building an XML viewer on AIR with Flex


Karl Matthews

Karl Matthews

Adobe

Table of Contents

Created:
17 March 2008
User Level:
Beginner, Intermediate
Products:
Adobe AIR

Adobe AIR, Flex, and XML combine to create a compelling platform for delivering engaging applications. A great example of this is to take a structured document in XML and present the information in a new and effective way. Interest in building intelligent viewers for XML documents is growing rapidly, especially among technical communicators. Technical writers are quickly adopting structured authoring and therefore are able to deliver their content in XML, using standards such as DITA (for topic-based information such as Help), S1000D (in aerospace or defense environments), SPL (for pharmaceutical products), and so on.

This article demonstrates how easy it is to develop an XML document viewer in Flex, and then use Adobe AIR to package and deliver the application. Figure 1 shows the product information for a line of sunglasses in the XML Viewer sample application. Although the focus in this article is to deliver a standalone application, the same Flex code can be reused to deliver a hosted rich Internet application (RIA) via a browser.

Note: This article is a good starting point for someone new to Flex or Adobe AIR, because it provides a walkthrough for how a complete application can be built with surprisingly few lines of code. You don't need much familiarity with ActionScript to understand this project, because nearly all the code is MXML. Alternatively, if you are well-versed in Flex, you may find the design of this application to be rather novel, because it is written in a declarative style of programming and shows an efficient way to build an application using just a few MXML components.

An XML viewer sample application built on AIR.

Figure 1. The XML Viewer sample application is built on AIR.

Requirements

In order to complete this tutorial, you need the following software and files:

Flex Builder 3

Adobe AIR

Sample files:

Prerequisite knowledge

Basic knowledge of Flex and MXML is suggested, although you should be able to follow along in the code walkthrough provided in this article even if you are new to Flex and MXML. To be able to edit and extend the application, some familiarity with Flex Builder is required. If you have experience with structured authoring, representing structured documents in XML, or transforming XML into HTML using XSLT, you will recognize many aspects of this application's design.

About the author

Karl Matthews leads a marketing team at Adobe Systems, Incorporated. XML and structured documents have been a part of his life for 10 years, through his connection with Adobe FrameMaker. Always on the look-out for new trends and innovations in the markets he covers, Karl has developed a series of demonstrations and proofs of concept showing how structured content can be transformed, processed, and reused to create a range of engaging experiences in different media, from print, PDF, HTML, mobile, and Adobe Flash format.