I've run into an issue with AIR. I'm trying to save out a file and then open that file once it has saved out successfully. The file is saved out to disk just fine, but when I then try to load it in, I get an error.
If I close the program and restart it, it can open the file just fine. Also, I am able to open the file outside of the program. It just seems to not allow the instance of the program that created the file to open it. I'm closing the filestream so that shouldn't be an issue. Here's some code for reference:
var fs:FileStream = new FileStream();
var f:File = new File(File.applicationDirectory.nativePath + "\\myTest.flv");
fs.writeBytes(_baFlvEncoder.byteArray, 0, _baFlvEncoder.byteArray.length);
Then later I try to play the file:
The code above generates this error:
Error #2044: Unhandled NetStatusEvent:. level=error, code=NetStream.Play.StreamNotFound
Is there some kind of security restriction in AIR that won't allow you to open a newly created file? If so, is there some kind of work around available?