Filtering Data Using XML and Flash

01 :: Introduction

Importing dynamic data into Flash using XML has been possible for quite a while now, yet few applications take full advantage of the relational data structures inherent to XML. XML can give the same kind of powerful functionality to your Flash application as a relational database. This tutorial will demonstrate how to utilize key indices in XML to perform database-like filtering through Flash.

Files

Download Filtering_Tutorial.zip

The zip file contains two files:

  1. Filtering_Tutorial.fla is the Flash file we will be reviewing
  2. contacts.xml is the XML file containing our data set

Potential Applications

For the purposes of this tutorial we will be looking at an address book interface that allows filtering of contacts by group (Work, Family, Friends). However, the functionality covered here has an almost infinite variety of applications. Essentially, this technique can be used anytime you have data that you want to organize or filter by categories. Examples include:

and much more...

Audience

This tutorial is intended for Flash developers who already have the following knowledge:

  1. A solid understanding of ActionScript
  2. Prior experience integrating XML with Flash
    (For a some introductory tutorials on XML and Flash integration see Introduction to XML in Flash and Displaying XML Data in Flash)

Interface

Below is a working example of the interface we will be using for this tutorial.

In order to view this site, you need the free Flash Player 7. You currently do not have the necessary version of Flash Player installed.

download flash player

02: Writing The XML File