<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" 
      xmlns:thr="http://purl.org/syndication/thread/1.0">
  <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/03/beginning-air-accessing-the-fi-1.html" />
  <link rel="self" type="application/atom+xml" href="http://www.insideria.com/atom.xml" />
  <id>tag:www.insideria.com,2009://34/tag:www.insideria.com,2008://34.23045-</id>
  <updated>2009-11-05T20:17:08Z</updated>
  <title>Comments for Beginning AIR - Accessing the File System Part 2 (http://www.insideria.com/2008/03/beginning-air-accessing-the-fi-1.html)</title>
  <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.21-en</generator>
  <entry>
    <id>tag:www.insideria.com,2008://34.23045</id>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/03/beginning-air-accessing-the-fi-1.html" />
    <link rel="service.edit" type="application/atom+xml" href="http://blogs.oreilly.com/cgi-bin/mt/mt-atom.cgi/weblog/blog_id=34/entry_id=23045" title="Beginning AIR - Accessing the File System Part 2" />
    <published>2008-03-25T16:00:00Z</published>
    <updated>2008-03-25T16:40:17Z</updated>
    <title>Beginning AIR - Accessing the File System Part 2</title>
    <summary>This excerpt is the second part of Chapter 8 of the upcoming (March 17, 2008 - NOW SHIPPING) book titled Beginning AIR: Building Applications for the Adobe Integrated Runtime ISBN: 0470229047. Beginning AIR is written in a walk through style where the examples are built upon throughout each section of the book. The easiest way to learn how to use the API&apos;s covered is to create the examples and follow along as they are built upon.

This excerpt covers how to use the File class to create, move, copy, and delete files. It will also demonstrate the usage of the FileStream class for working with the contents of individual files.</summary>
    <author>
      <name>Rich Tretola</name>
      <uri>http://blog.everythingflex.com</uri>
    </author>
    
    <category term="Features" />
    
    <content type="html" xml:lang="en" xml:base="http://www.insideria.com/">
      <![CDATA[<div class="ap_r" style="margin: 16px;"><a href="http://www.insideria.com/upload/2008/03/beginning_air_accessing_the_fi/1_0470229047.jpg" class="highslide" onclick="return hs.expand(this)"><img src="http://www.insideria.com/upload/2008/03/beginning_air_accessing_the_fi/1_0470229047.jpg" alt="1_0470229047.jpg" title="Click to enlarge" width="148"/></a></div>This excerpt is the first part of Chapter 8 of the upcoming (March 17, 2008 - <strong>NOW SHIPPING</strong>) book titled <a href="http://www.amazon.com/gp/product/0470229047?&camp=212361&creative=383837&linkCode=wss&tag=everythingfle-20" target="_blank">Beginning AIR: Building Applications for the Adobe Integrated Runtime ISBN: 0470229047</a>. Beginning AIR is written in a walk through style where the examples are built upon throughout each section of the book. The easiest way to learn how to use the API's covered is to create the examples and follow along as they are built upon.
<br/>
<br/>
<a href="http://www.insideria.com/2008/03/beginning-air-accessing-the-fi.html">Part 1</a> of this series gave examples of how to work with directories within the file system. This excerpt covers how to use the File class to create, move, copy, and delete files. It will also demonstrate the usage of the FileStream class for working with the contents of individual files.
<br/>
<br/>
<h1>Files</h1>
Working with files is very similar to working with directories, with the addition of the flash.filesystem.FileStream class for interactions with the contents of an individual file and the flash.filesystem.FileMode class for opening a file with specific permissions (read, write, etc.). The next group of samples will work with the same project and build upon it with each new piece of functionality. To get started, create a new AIR project and name it Chapter8_File. You should now have an empty file named Chapter8_File.mxml that looks like Listing 8-4. Please note that the completed code for Chapter8_File.mxml is shown in Listing 8-5.
<br/><br/>
<strong>Listing 8-4: Empty Chapter8_File.mxml file used for the next example set.</strong>
<br/>
<div class="acode" style="overflow: auto; padding: 10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>
&lt;?xml <span class="category2">version</span>="<span class="quote">1.0</span>" encoding="<span class="quote">utf-8</span>"?&gt;
&lt;mx:WindowedApplication xmlns:mx="<span class="quote">http://www.adobe.com/2006/mxml</span>"
    layout="<span class="quote">absolute</span>"&gt;

&lt;/mx:WindowedApplication&gt;</pre>
</code>

</div></div> 

In addition to the READ constant of the FileMode class, the class also has WRITE, UPDATE, and
APPEND constants. The definitions of these constants are as follows:<br/><br/>
<ul>
	<li><strong>FileMode.READ</strong> will open a file for read only. The file must exist to avoid a File I/O error.<br/><br/></li>
	<li><strong>FileMode.WRITE</strong> will open a file with full Write permissions. If the file does not exist, it will be created. If the file does exist, its contents will be overwritten.<br/><br/></li>
	<li><strong>FileMode.APPEND</strong> will open a file with full append access. If the file does not exist, it will be created. If the file does exist, any additions will occur at the end of any existing contents, and no data will be overwritten.<br/><br/></li>
	<li><strong>FileMode.UPDATE</strong> will open a file with read and write access. If the file does not exist, it will be created. Only changed data will be overwritten when a file is open with UPDATE.</li>
</ul>
<br/><br/>
<strong>Create a File</strong><br/>
<br/>
Creating a new file is the same process as creating a directory. The following sample will create a new
file by getting a reference with the File class and then opening the file with Write permissions using the
FileStream and FileMode classes. Finally, the file is written out using the writeUTFBytes method,
and the stream is closed. Starting with the empty Chaper8_file.mxml file, add the following <mx:Script>
block:<br/>
<div class="acode" style="overflow: auto; padding: 10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>
&lt;mx:Script&gt;
&lt;![CDATA[
<span class="category1">import</span> flash.filesystem.FileMode;
<span class="category1">import</span> flash.filesystem.FileStream;
<span class="category1">import</span> flash.filesystem.File;
<span class="category1">private</span> <span class="category1">function</span> createFile():<span class="category1">void</span>{
     <span class="category1">var</span> newFile:File = File.desktopDirectory.resolvePath("<span class="quote">MyNewFile.txt</span>");
     <span class="category1">var</span> fileStream:FileStream = <span class="category1">new</span> FileStream();
     fileStream.open(newFile, FileMode.WRITE);
     fileStream.writeUTFBytes("<span class="quote">Beginning air</span>");
     fileStream.<span class="category2">close</span>();
}
]]&gt;
&lt;/mx:Script&gt;</pre>
</code>

</div></div>
Now add the following button:<br/>
<br/>
<div class="acode" style="overflow: auto; padding: 10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>
&lt;mx:<span class="category2">Button</span> <span class="category1">label</span>="<span class="quote">Create File</span>"
    click="<span class="quote">createFile()</span>" <span class="category2">y</span>="<span class="quote">10</span>" horizontalCenter="<span class="quote">0</span>"/&gt;</pre>
</code>

</div></div>
<br/>
The results can be seen in Figure 8-2.<br/>
<br/>
<div class="ap_c"style="margin: 16px;"><a href="http://www.insideria.com/upload/2008/03/beginning_air_accessing_the_fi_1/229040_fg802.png" class="highslide" onclick="return hs.expand(this)"><img src="http://www.insideria.com/upload/2008/03/beginning_air_accessing_the_fi_1/229040_fg802.png" alt="229040_fg802.png" title="Click to enlarge" width="400"/></a><div class="apcaption">Figure 8-2: The newly created text file.</div></div>
<br/>
<br/>
<strong>Read a File</strong><br/>
<br/>
To read the file we just created back in, you will need to open the FileStream with the FileMode.READ
constant. To demonstrate this, simply add the following function:<br/>
<br/>
<div class="acode" style="overflow: auto; padding: 10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>
<span class="category1">private</span> <span class="category1">function</span> readFile():<span class="category1">void</span>{
     <span class="category1">var</span> myFile:File = File.desktopDirectory.resolvePath("<span class="quote">MyNewFile.txt</span>");
     <span class="category1">var</span> fileStream:FileStream = <span class="category1">new</span> FileStream();
     fileStream.open(myFile, FileMode.READ);
     Alert.<span class="category2">show</span>(fileStream.readUTFBytes(fileStream.bytesAvailable),"<span class="quote">Read File</span>");
     fileStream.<span class="category2">close</span>();
}</pre>
</code>

</div></div>
<br/>
Since this example uses an Alert to show the results of the file read, you will also need to add an import
statement.<br/>
<br/>
<div class="acode" style="overflow: auto; padding: 10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>
<span class="category1">import</span> mx.controls.Alert;</pre>
</code>

</div></div>
<br/>
Finally add another button to trigger the new function.<br/>
<br/>
<div class="acode" style="overflow: auto; padding: 10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>
&lt;mx:<span class="category2">Button</span> <span class="category1">label</span>="<span class="quote">Read File</span>"
    click="<span class="quote">readFile()</span>" <span class="category2">y</span>="<span class="quote">40</span>" horizontalCenter="<span class="quote">0</span>"/&gt;</pre>
</code>

</div></div>
<br/>
Be sure to create the file before attempting to read the file to avoid a file error. (Error #3003: File or
directory does not exist.)<br/>
<br/>
The results of the file read will look like Figure 8-3.<br/>
<br/>
<div class="ap_c"style="margin: 16px;"><a href="http://www.insideria.com/upload/2008/03/beginning_air_accessing_the_fi_1/229040_fg803.png" class="highslide" onclick="return hs.expand(this)"><img src="http://www.insideria.com/upload/2008/03/beginning_air_accessing_the_fi_1/229040_fg803.png" alt="229040_fg803.png" title="Click to enlarge" width="400"/></a><div class="apcaption">Figure 8-3: Example showing the File Read function.</div></div>
<br/>
<strong>Update a File</strong><br/>
<br/>
Updating a file requires that it is opened in UPDATE mode. The following example will open a file in
UPDATE mode and write a new chunk of data at a specific position in the file:<br/>
<br/>
<div class="acode" style="overflow: auto; padding: 10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>
<span class="category1">private</span> <span class="category1">function</span> updateFile():<span class="category1">void</span>{
     <span class="category1">var</span> myFile:File = File.desktopDirectory.resolvePath("<span class="quote">MyNewFile.txt</span>");
     <span class="category1">var</span> fileStream:FileStream = <span class="category1">new</span> FileStream();
     fileStream.open(myFile, FileMode.UPDATE);
     fileStream.<span class="category2">position</span> = 10;
     fileStream.writeUTFBytes("<span class="quote">AIR</span>");
     fileStream.<span class="category2">close</span>();
}
&lt;mx:<span class="category2">Button</span> <span class="category1">label</span>="<span class="quote">Update File</span>"
    click="<span class="quote">updateFile()</span>" <span class="category2">y</span>="<span class="quote">70</span>" horizontalCenter="<span class="quote">0</span>"/&gt;</pre>
</code>

</div></div>
<br/>
To test this, run the application and create the file using the Create File button. Next, click the Read File
button and you should see something similar to Figure 8-3. Now, click the Update File button and then
again click the Read File button, and you should now see something similar to Figure 8-4.<br/>
<br/>
<div class="ap_c"style="margin: 16px;"><a href="http://www.insideria.com/upload/2008/03/beginning_air_accessing_the_fi_1/229040_fg804.png" class="highslide" onclick="return hs.expand(this)"><img src="http://www.insideria.com/upload/2008/03/beginning_air_accessing_the_fi_1/229040_fg804.png" alt="229040_fg804.png" title="Click to enlarge" width="400"/></a><div class="apcaption">Figure 8-4: The file after it has been updated.</div></div>
<br/>
<strong>Append to a File</strong><br/>
<br/>
To append to a file, you should open the file with FileMode.APPEND. The following function will open
the file in APPEND mode and will append some data to the file:<br/>
<br/>
<div class="acode" style="overflow: auto; padding: 10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>
<span class="category1">private</span> <span class="category1">function</span> appendFile():<span class="category1">void</span>{
     <span class="category1">var</span> myFile:File = File.desktopDirectory.resolvePath("<span class="quote">MyNewFile.txt</span>");
     <span class="category1">var</span> fileStream:FileStream = <span class="category1">new</span> FileStream();
     fileStream.open(myFile, FileMode.APPEND);
     fileStream.writeUTFBytes("<span class="quote"> by Rich Tretola</span>");
     fileStream.<span class="category2">close</span>();
}
&lt;mx:<span class="category2">Button</span> <span class="category1">label</span>="<span class="quote">Append File</span>"
    click="<span class="quote">appendFile()</span>" <span class="category2">y</span>="<span class="quote">100</span>" horizontalCenter="<span class="quote">0</span>"/&gt;</pre>
</code>

</div></div>
<br/>
To test this, run the application and create the file using the Create File button. Next, click the Read File
button and you should see something similar to Figure 8-3. Now, click the Update File button and then
again click the Read File button, and you should see something similar to Figure 8-4. Finally, click the
Append File button to append some text, and then hit the Read File button again. You should now see
something similar to Figure 8-5.<br/>
<<div class="ap_c"style="margin: 16px;"><a href="http://www.insideria.com/upload/2008/03/beginning_air_accessing_the_fi_1/229040_fg805.png" class="highslide" onclick="return hs.expand(this)"><img src="http://www.insideria.com/upload/2008/03/beginning_air_accessing_the_fi_1/229040_fg805.png" alt="229040_fg805.png" title="Click to enlarge" width="400"/></a><div class="apcaption">Figure 8-5: The file after it has been appended.</div></div>
<br/>
<strong>Move a File</strong><br/>
To move a file, use the moveTo method of the File class. Add the following function and button to the
Chapter8_File.mxml file:<br/>
<br/>
<div class="acode" style="overflow: auto; padding: 10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>
<span class="category1">private</span> <span class="category1">function</span> moveFile():<span class="category1">void</span>{
     <span class="category1">var</span> originalLoc:File = File.desktopDirectory.resolvePath("<span class="quote">MyNewFile.txt</span>");
     <span class="category1">var</span> newLoc:File = File.desktopDirectory.resolvePath("<span class="quote">MovedFile.txt</span>");
     originalLoc.<span class="category2">moveTo</span>(newLoc);
}
&lt;mx:<span class="category2">Button</span> <span class="category1">label</span>="<span class="quote">Move File</span>"
    click="<span class="quote">moveFile()</span>" <span class="category2">y</span>="<span class="quote">130</span>" horizontalCenter="<span class="quote">0</span>"/&gt;</pre>
</code>

</div></div>
<br/>
Be sure to create the file before attempting to move the file to avoid a file error. (Error #3003: File or
directory does not exist.)<br/>
<br/>
<strong>Copy a File</strong><br/>
<br/>
To copy a file, use the copyTo method of the File class. Add the following function and button to the
Chapter8_File.mxml file:<br/>
<br/>
<div class="acode" style="overflow: auto; padding: 10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>
<span class="category1">private</span> <span class="category1">function</span> copyFile():<span class="category1">void</span>{
     <span class="category1">var</span> originalLoc:File = File.desktopDirectory.resolvePath("<span class="quote">MyNewFile.txt</span>");
     <span class="category1">var</span> copyLoc:File = File.desktopDirectory.resolvePath("<span class="quote">MyNewFileCopy.txt</span>");
     originalLoc.copyTo(copyLoc);
}
&lt;mx:<span class="category2">Button</span> <span class="category1">label</span>="<span class="quote">Copy File</span>"
    click="<span class="quote">copyFile()</span>" <span class="category2">y</span>="<span class="quote">160</span>" horizontalCenter="<span class="quote">0</span>"/&gt;</pre>
</code>

</div></div>
<br/>
Be sure to create the file before attempting to copy the file to avoid a file error. (Error #3003: File or
directory does not exist.)<br/>
<br/>
<strong>Delete a File</strong><br/>
<br/>
To copy a file, use the deleteFile method of the File class. Add the following function and button to
the Chapter8_File.mxml file:<br/>
<br/>
<div class="acode" style="overflow: auto; padding: 10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>
<span class="category1">private</span> <span class="category1">function</span> deleteFile():<span class="category1">void</span>{
     <span class="category1">var</span> newFile:File = File.desktopDirectory.resolvePath("<span class="quote">MyNewFile.txt</span>");
     newFile.deleteFile ();
}
&lt;mx:<span class="category2">Button</span> <span class="category1">label</span>="<span class="quote">Delete File</span>"
    click="<span class="quote">deleteFile()</span>" <span class="category2">y</span>="<span class="quote">190</span>" horizontalCenter="<span class="quote">0</span>"/&gt;</pre>
</code>

</div></div>
<br/>
Be sure to create the file before attempting to delete the file to avoid a file error. (Error #3003: File or
directory does not exist.)<br/>
<br/>
<strong>Move a File to Trash</strong><br/>
<br/>
To copy a file, use the moveToTrash method of the File class. Add the following function and button to
the Chapter8_File.mxml file:<br/>
<br/><div class="acode" style="overflow: auto; padding: 10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>
<span class="category1">private</span> <span class="category1">function</span> moveFileToTrash():<span class="category1">void</span>{
     <span class="category1">var</span> newFile:File = File.desktopDirectory.resolvePath("<span class="quote">MyNewFile.txt</span>");
     newFile.moveToTrash();
}
&lt;mx:<span class="category2">Button</span> <span class="category1">label</span>="<span class="quote">Move File to Trash</span>"
    click="<span class="quote">moveFileToTrash()</span>" <span class="category2">y</span>="<span class="quote">220</span>" horizontalCenter="<span class="quote">0</span>"/&gt;</pre>
</code>

</div></div>
<br/>
Be sure to create the file before attempting to move a file to the trash to avoid a file error. (Error #3003:
File or directory does not exist.) The completed code for Chapter8_File.mxml is shown in Listing 8-5.<br/>
<br/>
 <div class="acode" style="overflow: auto; padding: 10px;" ><div style="overflow-x: visible;">
<code language="perl">
<pre>
&lt;?xml <span class="category2">version</span>="<span class="quote">1.0</span>" encoding="<span class="quote">utf-8</span>"?&gt;
&lt;mx:WindowedApplication xmlns:mx="<span class="quote">http://www.adobe.com/2006/mxml</span>"
    layout="<span class="quote">absolute</span>"&gt;
    &lt;mx:Script&gt;
    &lt;![CDATA[
    <span class="category1">import</span> flash.filesystem.FileMode;
    <span class="category1">import</span> flash.filesystem.FileStream;
    <span class="category1">import</span> flash.filesystem.File;
    <span class="category1">import</span> mx.controls.Alert;
    <span class="blockcomment">/*
    Create a new file
    */</span>
    <span class="category1">private</span> <span class="category1">function</span> createFile():<span class="category1">void</span>{
         <span class="category1">var</span> newFile:File = File.desktopDirectory.resolvePath("<span class="quote">MyNewFile.txt</span>");
         <span class="category1">var</span> fileStream:FileStream = <span class="category1">new</span> FileStream();
         fileStream.open(newFile, FileMode.WRITE);
         fileStream.writeUTFBytes("<span class="quote">Beginning air</span>");
         fileStream.<span class="category2">close</span>();
     }
    <span class="blockcomment">/*
    Read in a file
    Note: Be sure to create the file first
    */</span>
    <span class="category1">private</span> <span class="category1">function</span> readFile():<span class="category1">void</span>{
         <span class="category1">var</span> myFile:File = File.desktopDirectory.resolvePath("<span class="quote">MyNewFile.txt</span>");
         <span class="category1">var</span> fileStream:FileStream = <span class="category1">new</span> FileStream();
         fileStream.open(myFile, FileMode.READ);
         Alert.<span class="category2">show</span>(fileStream.readUTFBytes(fileStream.bytesAvailable),"<span class="quote">Read File</span>");
         fileStream.<span class="category2">close</span>();
     }
    <span class="blockcomment">/*
    Update a file
    */</span>
    <span class="category1">private</span> <span class="category1">function</span> updateFile():<span class="category1">void</span>{
         <span class="category1">var</span> myFile:File = File.desktopDirectory.resolvePath("<span class="quote">MyNewFile.txt</span>");
         <span class="category1">var</span> fileStream:FileStream = <span class="category1">new</span> FileStream();
         fileStream.open(myFile, FileMode.UPDATE);
         fileStream.<span class="category2">position</span> = 10;
         fileStream.writeUTFBytes("<span class="quote">AIR</span>");
         fileStream.<span class="category2">close</span>();
     }
    <span class="blockcomment">/*
    Append to a file
    */</span>
    <span class="category1">private</span> <span class="category1">function</span> appendFile():<span class="category1">void</span>{
         <span class="category1">var</span> myFile:File = File.desktopDirectory.resolvePath("<span class="quote">MyNewFile.txt</span>");
         <span class="category1">var</span> fileStream:FileStream = <span class="category1">new</span> FileStream();
         fileStream.open(myFile, FileMode.APPEND);
         fileStream.writeUTFBytes("<span class="quote"> by Rich Tretola</span>");
         fileStream.<span class="category2">close</span>();
     }
    <span class="blockcomment">/*
    Move a file
    NOTE: Be sure to create the file
    first before attempting to move
    */</span>
    <span class="category1">private</span> <span class="category1">function</span> moveFile():<span class="category1">void</span>{
         <span class="category1">var</span> originalLoc:File = File.desktopDirectory.resolvePath("<span class="quote">MyNewFile.txt</span>");
         <span class="category1">var</span> newLoc:File = File.desktopDirectory.resolvePath("<span class="quote">MovedFile.txt</span>");
         originalLoc.<span class="category2">moveTo</span>(newLoc);
     }
    <span class="blockcomment">/*
    Copy a file
    NOTE: Be sure to create the file
    first before attempting to copy
    */</span>
    <span class="category1">private</span> <span class="category1">function</span> copyFile():<span class="category1">void</span>{
         <span class="category1">var</span> originalLoc:File = File.desktopDirectory.resolvePath("<span class="quote">MyNewFile.txt</span>");
         <span class="category1">var</span> copyLoc:File = File.desktopDirectory.resolvePath("<span class="quote">MyNewFileCopy.txt</span>");
         originalLoc.copyTo(copyLoc);
     }
    <span class="blockcomment">/*
    Delete a file
    NOTE: Be sure to create the file
    first before attempting to delete it
    */</span>
    <span class="category1">private</span> <span class="category1">function</span> deleteFile():<span class="category1">void</span>{
         <span class="category1">var</span> newFile:File = File.desktopDirectory.resolvePath("<span class="quote">MyNewFile.txt</span>");
         newFile.deleteFile();
     }
    <span class="blockcomment">/*
    Move a directory to Trash
    NOTE: Be sure to create the file
    first before attempting to move it to Trash
    */</span>
    <span class="category1">private</span> <span class="category1">function</span> moveFileToTrash():<span class="category1">void</span>{
         <span class="category1">var</span> newFile:File = File.desktopDirectory.resolvePath("<span class="quote">MyNewFile.txt</span>");
         newFile.moveToTrash();
     }
    ]]&gt;
    &lt;/mx:Script&gt;
    &lt;mx:<span class="category2">Button</span> <span class="category1">label</span>="<span class="quote">Create File</span>"
        click="<span class="quote">createFile()</span>" <span class="category2">y</span>="<span class="quote">10</span>" horizontalCenter="<span class="quote">0</span>"/&gt;
    &lt;mx:<span class="category2">Button</span> <span class="category1">label</span>="<span class="quote">Read File</span>"
        click="<span class="quote">readFile()</span>" <span class="category2">y</span>="<span class="quote">40</span>" horizontalCenter="<span class="quote">0</span>"/&gt;
    &lt;mx:<span class="category2">Button</span> <span class="category1">label</span>="<span class="quote">Update File</span>"
        click="<span class="quote">updateFile()</span>" <span class="category2">y</span>="<span class="quote">70</span>" horizontalCenter="<span class="quote">0</span>"/&gt;
    &lt;mx:<span class="category2">Button</span> <span class="category1">label</span>="<span class="quote">Append File</span>"
        click="<span class="quote">appendFile()</span>" <span class="category2">y</span>="<span class="quote">100</span>" horizontalCenter="<span class="quote">0</span>"/&gt;
    &lt;mx:<span class="category2">Button</span> <span class="category1">label</span>="<span class="quote">Move File</span>"
        click="<span class="quote">moveFile()</span>" <span class="category2">y</span>="<span class="quote">130</span>" horizontalCenter="<span class="quote">0</span>"/&gt;
    &lt;mx:<span class="category2">Button</span> <span class="category1">label</span>="<span class="quote">Copy File</span>"
        click="<span class="quote">copyFile()</span>" <span class="category2">y</span>="<span class="quote">160</span>" horizontalCenter="<span class="quote">0</span>"/&gt;
    &lt;mx:<span class="category2">Button</span> <span class="category1">label</span>="<span class="quote">Delete File</span>"
        click="<span class="quote">deleteFile()</span>" <span class="category2">y</span>="<span class="quote">190</span>" horizontalCenter="<span class="quote">0</span>"/&gt;
    &lt;mx:<span class="category2">Button</span> <span class="category1">label</span>="<span class="quote">Move File to Trash</span>"
        click="<span class="quote">moveFileToTrash()</span>" <span class="category2">y</span>="<span class="quote">220</span>" horizontalCenter="<span class="quote">0</span>"/&gt;
&lt;/mx:WindowedApplication&gt;</pre>
</code>

</div></div> 
<br>
The 3rd and final part of this series will cover Asynchronous versus Synchronous file system access.]]>
      
    </content>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.23045-comment:2016138</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.23045" type="text/html" href="http://www.insideria.com/2008/03/beginning-air-accessing-the-fi-1.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/03/beginning-air-accessing-the-fi-1.html#comment-2016138" />
    <title>Comment from Rhys Tague on 2008-03-25</title>
    <author>
        <name>Rhys Tague</name>
        <uri>http://www.rhycom.com.au</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.rhycom.com.au">
        <![CDATA[<p>Another great post Rich,<br />
I love the new aspects of being able to access the file system with ActionScript.</p>

<p>cheers,</p>]]>
    </content>
    <published>2008-03-25T22:47:08Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.23045-comment:2016139</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.23045" type="text/html" href="http://www.insideria.com/2008/03/beginning-air-accessing-the-fi-1.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/03/beginning-air-accessing-the-fi-1.html#comment-2016139" />
    <title>Comment from Rich TretolaTha on 2008-03-25</title>
    <author>
        <name>Rich TretolaTha</name>
        <uri>http://blog.everythingflex.com</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://blog.everythingflex.com">
        <![CDATA[<p>Thanks Rhys,</p>

<p>I agree, although this was obviously a standard for desktop apps for years. It is really cool that we can now do the same with a familiar language like AS3.</p>]]>
    </content>
    <published>2008-03-25T23:31:02Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.23045-comment:2016141</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.23045" type="text/html" href="http://www.insideria.com/2008/03/beginning-air-accessing-the-fi-1.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/03/beginning-air-accessing-the-fi-1.html#comment-2016141" />
    <title>Comment from Douglas McCarroll on 2008-03-25</title>
    <author>
        <name>Douglas McCarroll</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Rich - Does your book cover using RemoteObject with BlazeDS from AIR?</p>]]>
    </content>
    <published>2008-03-26T01:42:29Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.23045-comment:2016142</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.23045" type="text/html" href="http://www.insideria.com/2008/03/beginning-air-accessing-the-fi-1.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/03/beginning-air-accessing-the-fi-1.html#comment-2016142" />
    <title>Comment from Rich TretolaTha on 2008-03-25</title>
    <author>
        <name>Rich TretolaTha</name>
        <uri>http://blog.everythingflex.com</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://blog.everythingflex.com">
        <![CDATA[<p>It does not cover BlazeDS. It does show how to connect to Http services and RemoteObject via ColdFusion. Here is teh full table of contents:<br />
<a href="http://blog.everythingflex.com/2008/01/18/beginning-air-in-the-can/">http://blog.everythingflex.com/2008/01/18/beginning-air-in-the-can/</a></p>]]>
    </content>
    <published>2008-03-26T01:45:37Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.23045-comment:2041952</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.23045" type="text/html" href="http://www.insideria.com/2008/03/beginning-air-accessing-the-fi-1.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/03/beginning-air-accessing-the-fi-1.html#comment-2041952" />
    <title>Comment from Ajitpal singh on 2008-08-28</title>
    <author>
        <name>Ajitpal singh</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>This post is really nice Rich... well i was working on a problem. can we create custom themes for Flash Air like having black border</p>]]>
    </content>
    <published>2008-08-28T10:40:26Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.23045-comment:2041959</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.23045" type="text/html" href="http://www.insideria.com/2008/03/beginning-air-accessing-the-fi-1.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/03/beginning-air-accessing-the-fi-1.html#comment-2041959" />
    <title>Comment from Rich Tretola on 2008-08-28</title>
    <author>
        <name>Rich Tretola</name>
        <uri>http://blog.everythingflex.com</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://blog.everythingflex.com">
        <![CDATA[<p>Ajitpal,</p>

<p>I am not really sure what you mean? Are you referring to custom Chrome in place of the OS Chrome? If yes, than the answer is certainly and this is covered in my book.</p>]]>
    </content>
    <published>2008-08-28T13:59:35Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.23045-comment:2058160</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.23045" type="text/html" href="http://www.insideria.com/2008/03/beginning-air-accessing-the-fi-1.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/03/beginning-air-accessing-the-fi-1.html#comment-2058160" />
    <title>Comment from roulette casino game online on 2009-04-23</title>
    <author>
        <name>roulette casino game online</name>
        <uri>http://www.rouletttegaming.com</uri>
    </author>
    <content type="html" xml:lang="en" xml:base="http://www.rouletttegaming.com">
        <![CDATA[<p>It does not cover Blazes. It does show how to connect to HTTP services and Remote Object via Cold Fusion. Here is teh full table of contents:I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. In fact your creative writing abilities has inspired me.Really the blogging is spreading its wings rapidly. Your write up is  fine example of it.     <a href="http://www.rouletttegaming.com">http://www.rouletttegaming.com</a>	</p>]]>
    </content>
    <published>2009-04-23T12:48:45Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.23045-comment:2067987</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.23045" type="text/html" href="http://www.insideria.com/2008/03/beginning-air-accessing-the-fi-1.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/03/beginning-air-accessing-the-fi-1.html#comment-2067987" />
    <title>Comment from Ravindra Khade on 2009-07-09</title>
    <author>
        <name>Ravindra Khade</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>i want to open a file in a read/write mode wihch is present on network ie on other machin. plz suggest </p>]]>
    </content>
    <published>2009-07-09T10:17:23Z</published>
  </entry>

  <entry>
    <id>tag:www.insideria.com,2008://34.23045-comment:2097767</id>
    <thr:in-reply-to ref="tag:www.insideria.com,2008://34.23045" type="text/html" href="http://www.insideria.com/2008/03/beginning-air-accessing-the-fi-1.html"/>
    <link rel="alternate" type="text/html" href="http://www.insideria.com/2008/03/beginning-air-accessing-the-fi-1.html#comment-2097767" />
    <title>Comment from Bhola on 2009-09-14</title>
    <author>
        <name>Bhola</name>
        <uri></uri>
    </author>
    <content type="html" xml:lang="en" xml:base="">
        <![CDATA[<p>Hi, i want to acess a file while testing from flex builder. But this file should be  accessed the same way that it will be when i install the application. How do i do this? In this case is the sqlite3 database..</p>]]>
    </content>
    <published>2009-09-14T17:13:42Z</published>
  </entry>

</feed
