2 Replies Latest reply on Aug 1, 2008 8:23 AM by onekidney

    SecurityError on writing file with application air (flex)

    giorgiomediabook
      Flex Buider 3.0 Project for air.
      Mac OSX 10.4.11.

      I try to write a file with FileStream:

      myFileStream = new FileStream();
      var myFile:File = File.applicationDirectory.resolvePath(path);

      //myFileStream.addEventListener(Event.COMPLETE, TerminataLetturaTXT);
      myFileStream.open(myFile, FileMode.WRITE);
      myFileStream.writeUTF(righe);
      myFileStream.close();

      Error:
      SecurityError: fileWriteResource
      at runtime::SecurityManager$/checkPrivilegeForCaller()
      at flash.filesystem::FileStream/open()

      The file is in the folder of project with write permission.
      I can read the file.

      Why this error?
      Can help me?