In AS3 in AIR I'm using a URLLoader to load json data from a file for parsing. Then I want to add objects to the data and re-write the same file, using WRITE and not APPEND. The AIR compiler says, essentially "no can do, the file's in use."
Nullifying the data or closing the URLLoader before re-writing or deleting the file don't work.
How do you get control of a file once a URLLoader has loaded it's data?
Well, I see that this has been solved by others before. A very slight delay (actually a timer of 0 milliseconds!) is all that’s needed before the delete function to make this problem go away. Interestingly, if the timer is left out of the wait() function and deleteIt() is called from there instead, the problem returns.