1 Reply Latest reply on Aug 12, 2008 9:57 AM by Scott McAllister

    file handeling with AIR

    rauniyar_dinesh Level 1
      i get the following error
      SecurityError: fileWriteResource
      at runtime::SecurityManager$/checkPrivilegeForCaller()
      at flash.filesystem::FileStream/openAsync()
      at Player/savePlayList()

      when i try writing a file in "app:\" directory.
      all i want to do is write a new file in the same directory the application is run from.

      please help
      thanks in advance
      here is the code i m using

      var stream:FileStream = new FileStream();
      var urlStr:String = "app:/newPlayList.xml";
      var tempFile:File = new File();

      tempFile.url = urlStr;;
      //var myFile:File = File.documentsDirectory.resolvePath("AIR Test/test.txt");
      stream.openAsync(tempFile, FileMode.WRITE);
      stream.writeMultiByte(tempStr,"iso-8859-1");
      stream.close();