natalia Vikhtinskaya skriver:
> This is code in app
> var appDirectory:File =
> File.applicationDirectory;//File.applicationStorageDirectory
> var fileString:String = appDirectory.nativePath;
> var appFile:File = File.documentsDirectory;
> var
> setsFile:String=fileString+File.separator+"data"+File.separator+"sets.xml"
> 
> function initLoadXML():void{
> 
> var XMLfile:File = File.applicationDirectory.resolvePath(setsFile);
> 
> var myXMLLoader:URLLoader = new URLLoader(new URLRequest(XMLfile.url));
> 
> myXMLLoader.addEventListener(Event.COMPLETE, setsLoaded);
> }
> function saveXML():void{
>  var newFileStream:FileStream = new FileStream();
> appFile =
> appFile.resolvePath(fileString+File.separator+"data"+File.separator+"sets.xml");
> 
> newFileStream.openAsync (appFile, FileMode.WRITE);
> newFileStream.writeUTFBytes(xmlSets);
> newFileStream.close ();
> }
> Maybe here is something wrong with path or I store data in a wrong place.I
> have xml in the  folder data in the same folder as exe file with app.
> 

Yes, there is something wrong: you are violating all the guidelines
about correct filesystem use.

Ask the user where to save data when reasonable, and default to a sane
location.

And never ever attempt to write to a location reserved for program
files, only installers are allowed to touch those folders.


---
Detta epostmeddelande innehåller inget virus eller annan skadlig kod för avast! 
antivirus är aktivt.
http://www.avast.com


_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to