AIR applications are not permitted to write to the application resource directory. This seems to be a security feature and makes sense, because some systems would not allow to write into this directory at system level.
But for testing purposes you might hack this by using a single line of code:
Actionscript:
-
// Writing into that file would fail
-
var yourFileInAppDir: File = File.applicationDirectory.resolvePath( "yourFile.xml" );
-
// This is the simple hack:
-
yourFileInAppDir = new File( yourFileInAppDir.nativePath );
But this only avoids a AIR security error! You must be sure to have write access to the directory!
It’s really cool…I was trying too much to find a way to write to Application Directory. But, I didn’t find any direct approach.
It seems hard to believe at first….but it works..