Error #3003: File or directory does not exist with FileMode.WRITE
In short, here's the code:
var profileName:String ="Player1";
var fileName:String = "\\Data\\Profiles\\"+profileName+".dat";
var saveFile:File = File.documentsDirectory;
saveFile = saveFile.resolvePath(fileName);
var str:String = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
str+="\r\n <Plants>";
str+="\r\n </Plants>";
var localFileStream:FileStream = new FileStream();
localFileStream.open(saveFile, FileMode.WRITE);
localFileStream.writeMultiByte(str, "utf-8");
FileMode.WRITE should have created the file by itself, how come it still throws Error 3003?
Also, I traced the fileName string and it shows \Data\Profiles\Player1.dat is that the correct way to assign path?
