After reading this book, youre probably a little overwhelmed by the different choices you have for working with XML. Do you use the XML class or the data components? Should you use the Component Inspector to configure the data components or write ActionScript instead? Do you need to consider the XMLSocket class? In this chapter, Id like to provide a framework that you can use to make these decisions.
I believe that you face two choices:
Decide whether XML is the best choice to provide data for your application.
If you choose XML, decide how to include the XML content within Flash.
XML is a very flexible alternative for data exchange, but other options such as using a database or text file may be appropriate, depending on the type of application youre building. You can include XML within Flash by using the XMLSocket class, the XML class, or the data components. You can even script the data components or Web Service classes.
If XML is the best option for your Flash data, youll need to consider these factors:
Do you need real-time or multiuser interaction?
Is timeliness of information a factor?
Which version of Flash do you own?
Which Flash players are you targeting?
Do you prefer to work visually?
The good news is that there isnt a single correct way to work with Flash and XML. The choices that you make will depend on the type of application that youre building and your target audience. In this chapter, Ill explore these questions in more detail so that you can make informed decisions about the best way forward.