title: as3 save to root folder
body: <p>The following script is used to save a file to the desktop:</p>
  
  <pre><code>    var ba:ByteArray = new ByteArray();
      ba.writeUTFBytes(xmlData);
      var fs : FileStream = new FileStream;
      var targetFile : File = File.desktopDirectory.resolvePath('file.xml');
      fs.open(targetFile, FileMode.WRITE);
      fs.writeBytes(ba);
      fs.close();
  </code></pre>
  
  <p>The file is loaded from the same directory as the swf file. how do I save the file in this directory. The flash file is exported as an Air app</p>