Chapter 11. Reading Data Files

 <  Day Day Up  >  

Quite often, when you are developing an application, the need arises to access data from an external source. In this chapter, we cover the input of text into Flash from many sources, including text files, Hypertext Markup Language (HTML) parameters, the local SharedObject object, and the LocalConnection object.

The fundamental differences between them are as follows :

  • When the data is loaded

  • Whether the data will be persistent

  • Where the data is stored and maintained

For each external data source, we cover the mechanics as well as the justification for using one over the other. Table 11.1 enumerates the different types of data exchanges that might be required by a Flash application.

Table 11.1. Objects and Methods in Flash Used to Exchange Data
 

F LASH M OVIE

L OCAL

S ERVER

Flash Movie

LocalConnection object

SharedObject object (similar to cookies)

LoadVars object

 

SharedObject object (similar to cookies)

 

LoadVariables() method

 

LoadVars object

 

XML object

URL query string

FlashVars

N OTE

The XML object will not be covered in this chapter. See Chapter 12, "XML and Flash," for more information.


In this chapter, we cover the following:

  • loadVariables() method

  • LoadVars object

  • FlashVars

  • SharedObject object

  • LocalConnection object

Each provides its own advantages and disadvantages, as we will see in the following sections.

 <  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