I'm new to Air so forgive me if this is something rudimentery. I wrote an air application in Flash, that writes to an XML file. When testing it within flash (with in the Air debugger) everything works perfectly, but if the swf or exe is launched outside of flash the write functionality no longer functions. Pleas ehlp me if you can.
I'm having a very similar problem. Any calls I make to the air file api return this error:
VerifyError: Error #1014: Class flash.filesystem::File could not be found.
My app functions perfectly when I test in air debug, otherwise nothing works... ...
Did you publish the file? I ask because that's what solved my problem and uh . . . cause everybody has the right to be uniformed, I didn't realize that publishing in the Air sense is very different than publishing a flash file. It involves creating an installer. If you knew that already don't laugh. If not then maybe that's the first step.
The other thing that I've read with respect to newer operating systems is that writing to certain directories is blocked and the recommendation is that you use the application storage directory.
This bit will tell you where that is but I still couldn't get past it because uh . . . well you know
var f:File = File.applicationStorageDirectory.resolvePath("presentations.xml");
path_ti.text = f.nativePath;
Ah the bleeding edge . . .
What does this tell you:
Error #2044: Unhandled skinError:. text=Error #2047: Security sandbox violation: parent: file:///C:/Program Files/ElancoICP/Full/C106.swf cannot access app:/ElancoICP_THIS_ONE.swf.
Never mind . . . I will read up on this . . . Someday.
For my fellow coders, my issue seemed to stem from the fact that I was providing an absolute path to a child SWF which was playing the video.
I switched to relative path to the SWF and the original configs for the FLV and skin which were absolute and problem appears to be solved.
I guess this next bit of info also makes sandbox sense but JPGs accessed via an absolute path gave no error so I wasn't looking to hard a the code were the paths loading the children were defined.
I'm the first to admit that I'm not fully versed in AIR sandbox security, but here's a couple of things to consider.
If you embed the swf it will be loaded with the proper privledges. You might also be able to load with an app:/ URI, or via loadBytes() + allowLoadBytesCodeExecution.
Here are a couple of docs that might interest you when you have some free time