Home arrow Flash arrow Page 3 - Using the File System API
FLASH

Using the File System API


Adobe's Apollo is a cross platform desktop runtime. Use it with Flex, and you can build Flash-based Rich Internet Applications (RIA). This article, the first of two parts, shows you how to use Apollo's file system API. It is excerpted from chapter four of the book Apollo for Adobe Flex Developer's Pocket Guide, written by Mike Chambers, Rob Dixon and Jeff Swartz (O'Reilly, 2007; ISBN: 0596513917). Copyright © 2007 O'Reilly Media, Inc. All rights reserved. Used with permission from the publisher. Available from booksellers or direct from O'Reilly Media.

Author Info:
By: O'Reilly Media
Rating: 4 stars4 stars4 stars4 stars4 stars / 3
March 13, 2008
TABLE OF CONTENTS:
  1. · Using the File System API
  2. · Accessing Files and Directories
  3. · URI Schemes
  4. · Asynchronous and Synchronous Versions of Methods

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Using the File System API - URI Schemes
(Page 3 of 4 )

A URI scheme is specified at the beginning of a URL, such as file in the following example:

  file:///c:/ApolloTest/test.txt

In addition to thefileURI scheme, Apollo supports the new URI schemesapp-storageand
app-resource.

app-storage

Identifies the application storage directory, as shown in the following example:

  var logFile:File = File.appStorageDirectory;
  logFile = logFile.resolve("log.txt");
  trace(logFile.url); // app-storage:/log.txt

app-resource

Identifies this application’s installation folder, as in the following:

  var installDir:File = new File();
  installDir.url = "app-resource:/";
  installDir = installDir.resolve("HelloWorld-app.xml");
  trace(installDir.url); // app-resource:/HelloWorld-app.xml

file

The url property of otherFileobject returns a standardfileURL scheme:

  var file:File = File.documentsDirectory;
  file = file.resolve("ApolloTest/test.txt");
  trace(file.url);
    // On Windows:
   
// file:///C:/Documents%20and %20Settings/ ... /test.txt
   
// On Mac OS:
   
// file:///Users/userName/Documents/ ... /test.txt


blog comments powered by Disqus
FLASH ARTICLES

- More Top Flash Game Tutorials
- Top Flash Game Tutorials
- Best Flash Photo Gallery Tutorials
- The Top Flash Tutorials for Menus
- 7 Great Flash Tutorials
- Adobe Creative Suite 5.5 Now Available
- Critical Flash Vulnerability Heats Up the Web
- More on Nonpersistent Client-Side Remote Sha...
- Nonpersistent Client-Side Remote Shared Obje...
- Using the Decorator Pattern for a Real Web S...
- Using Concrete Decorator Classes
- Delving More Deeply into the Decorator Patte...
- The Decorator Pattern in Action
- A Simple Decorator Pattern Example
- Decorator Pattern

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 6 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials