<  Day Day Up  >  

In many cases, XML provides a viable solution for data access in a Flash document. Other options include Web Services and Flash Remoting, both covered in Chapter 13. Here are a few guidelines that will help you decide whether using XML to format data is the right choice for your application:

  • Performance and data load time. To use an XML document in Flash, the document has to first be downloaded and then parsed before any of the data can be used. Large XML documents can cause latency in the application. Loading the same information from a text file will be faster because little or no parsing is required. After the text file loads, the data is available. Another option is to break the XML into smaller files and load them incrementally. The XML file will be smaller if you use attributes as opposed to plain text nodes.

  • Loading XML data created for other applications. If the XML data is created for other applications, trying to merge it with Flash can cause undue parsing complexity. If possible, use XML data specifically designed for the Flash application. This will avoid any parsing problems.

  • Server and database load. Is the data required to be realtime? If so, the XML would need to be generated for each request. How do the database and server respond under heavy traffic? If generating live data for each request causes server load issues, consider generating the XML periodically (hourly or twice a day) based on the nature of the data. You can then cache it on the server.

  • Alternate solutions. Web Services and Flash Remoting are alternate solutions for loading data into a Flash application. Both require server-side applications to respond to data requests . For more on these alternate solutions, see Chapter 13.

 <  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 © 2008-2017.
If you may any questions please contact us: