Chapter 12. XML and Flash

 <  Day Day Up  >  

In Chapter 11, "Reading Data Files," we explored a few options for reading external data (text) into a Flash movie. LoadVars and URL or query strings were discussed, each revealing their strengths and weaknesses. You may recall that data was read into the applications as name -value pairs, as shown in Listing 12.1.

Listing 12.1. Name-Value Pairs
 myFlashMovie.swf?color=blue&fontsize=large 

It's easy to see that by using these techniques, data can get complicated rather quickly, as shown in Listing 12.2. There are also size limitations inherent in this kind of implementation.

Listing 12.2. Complex Name-Value Pairs
 myFlashMovie.swf?color=blue&fontsize=large&menuFontColor=white& stae=3&name=James&filter=true&prod1=872635&prod2=87411... 

In this chapter, extensible markup language (XML) will be introduced. XML can be used for reading and writing data to and from a server, providing an alternative to the limitations of techniques previously discussed. XML has been approved as a standard by the World Wide Web Consortium (W3C) and been adopted by many companies including Microsoft, Netscape, and Macromedia.

This chapter will focus on XML support in Flash, starting with a brief introduction to general XML concepts. For a more detailed discussion of general XML concepts, see the Real World XML , published by New Riders Press.

 <  Day Day Up  >  


Object-Oriented Programming with ActionScript 2.0
Object-Oriented Programming with ActionScript 2.0
ISBN: 0735713804
EAN: 2147483647
Year: 2004
Pages: 162

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net