7

Working with the Filesystem

WHAT YOU WILL LEARN IN THIS CHAPTER:

  • Creating File and FileStream objects
  • Resolving file object paths
  • Modifying files and directories
  • Using browse dialogs

This chapter takes a look at the AIR File System API in depth, again using Flash Builder to take you through related examples. These will help you to build applications that can create or utilize existing data on a user's mobile device, whether that data is an MP3 file found in the device's native media library, or an image file referenced from the photo gallery.

The key aspect of the API is getting to understand the filesystem, learning how to resolve paths to files, and containing folders on the device. This chapter looks at all this in depth.

image WARNING For security reasons the AIR File System API is restricted for use in non-browser Flash applications. Bear this in mind if you intend to create browser-based Flash mobile applications. In addition, Google Android and BlackBerry Tablet OS devices require users to grant usage of certain security levels when using the API.

Over the course of this chapter you'll construct a simple example running the majority of features.

READING FROM THE FILESYSTEM

To utilize the filesystem within your Flash mobile applications on a mobile device using AIR, you first need to familiarize yourself with the core classes involved in the API, and pay particular attention ...

Get Beginning Flash®, Flex®, and AIR® Development for Mobile Devices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.