Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
So far you've learned how to read the filesystem of a mobile device using AIR. In this section you take a look at modifying the filesystem objects.
To create files and folders on the mobile device, you need to use a combination of the File, FileStream, and FileMode classes.
The FileMode class is found in the flash.filesystem package. When creating ActionScript Mobile projects, you need to import the class through the following statement:
import flash.filesystem.FileMode;
When creating a Flex Mobile project in Flash Builder, you don't need to import the class.
The FileMode class provides four static constants. These are flags to define what a FileStream object should do with a File object it receives via the FileStream.open() method. At least one of these properties needs to be supplied as the second parameter in the open() method: