Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

7: Working with the Filesystem > MODIFYING FILES AND FILESYSTEMS

MODIFYING FILES AND FILESYSTEMS

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.

Creating New Files and Directories

To create files and folders on the mobile device, you need to use a combination of the File, FileStream, and FileMode classes.

Using the FileMode Class

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:


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial