applicationResourceDirectory or applicationStorageDirectory
Tuesday, November 6th, 2007This is small AIR tip: use File.applicationStorageDirectory instead of File.applicationResourceDirectory.
I’ve stuck on this error
SecurityError: fileWriteResource
at runtime::SecurityManager$/checkPrivilegeForCaller()
at flash.filesystem::File/moveToAsync()
at copy_fla::MainTimeline/copy_fla::frame1()
at runtime::ContentPlayer/loadInitialContent()
at runtime::ContentPlayer/playRawContent()
at runtime::ContentPlayer/playContent()
at runtime::AppRunner/run()
at global/runtime::ADLEntry()
After some googling I’ve found this forum post. That’s quite interesting. This is answer from Kevin Hoyt:
“As part of the additional security features added to AIR Beta 2, applications are no longer permitted to write to the application resource directory. It is recommended that you use applicationStorageDirectory.”
I’m just curious if applicationResourceDirectory is there just for backward compability of there is some other reason like you know, where is you application installed.
tagged under:





1 Trackbacks/Pingbacks
4 Comments
davidderaedt
• Visit Site
November 6th, 2007
Hi there
The thing is that you still can read from this directory. So, one case you could use it for would be to embed content during the AIR application install process, and then copy it to the storage directory.
More about this here.
DEL
• Visit Site
March 26th, 2008
var objFile:File = new File(”file:///” + File.applicationDirectory.resolvePath(strFilePath).nativePath);
the output would be like this…
file:///c:\del\userConf.xml
This will work fine.
Although this is wrong but what about those who want to edit installed files. Also this will not work if the user is not an administrator.
Tom
• Visit Site
April 16th, 2008
HAAA you CANT write on applicationDirectory on Vista! And moreover, application stop and wait wait wait….
But however you can write on DocumentDirectory, but AIR sould not be cross OS????
Eric
• Visit Site
October 14th, 2008
Thanks DEL for the solution. Works great.
Live Preview
Leave a comment