Copy link to clipboard
Copied
I have this method:
private function rewriteQueue():void {
try{
var file:File = File.applicationStorageDirectory.resolvePath( DATA_FILE_NAME );
file.deleteFile();
while (users.length) {
var aUser:Object = users.shift();
writeUser(aUser);
}
}catch (e:Error) {
}
}
That doesn't work and I'm just not sure why. Putting the while outside of the try/catch fixes it... but why?
Copy link to clipboard
Copied
OK, I figured out why the problem was occurring. It happened when there was no file to delete - the deleteFile() failed - also causing the while to not execute. My bad.