In your code, change every File.applicationDirectory to File. applicationStorageDirectory
On Sat, Mar 1, 2014 at 7:44 AM, natalia Vikhtinskaya <natavi.m...@gmail.com>wrote: > Ok, I understand. Where I must save my data?I have them in the same folder > as fla file. > > > 2014-03-01 16:58 GMT+04:00 Henrik Andersson <he...@henke37.cjb.net>: > > > 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 > > > _______________________________________________ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > -- Erik Mattheis _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders