| Adobe AIR 1.1 |
|
|
AIR file basicsAdobe AIR provides classes that you can use to access, create, and manage both files and folders. These classes, contained in the flash.filesystem package, are used as follows:
Some methods in the File class have both synchronous and asynchronous versions:
Also, FileStream operations work synchronously or asynchronously depending on how the FileStream object opens the file: by calling the open() method or by calling the openAsync() method. The asynchronous versions let you initiate processes that run in the background and dispatch events when complete (or when error events occur). Other code can execute while these asynchronous background processes are taking place. With asynchronous versions of the operations, you must set up event listener functions, using the addEventListener() method of the File or FileStream object that calls the function. The synchronous versions let you write simpler code that does not rely on setting up event listeners. However, since other code cannot execute while a synchronous method is executing, important processes such as display object rendering and animation may be paused. |