Adobe Air - FileMode.APPEND

Ajtpswwdomucd

New Member
I'm using the code below to add an image id to a .XML file:\[code\]var xmlGallery:XML =new XML ('<ENTRY "IMG_ID="' +img_id+'"/>')var fGallery:File = File.applicationStorageDirectory.resolvePath("gallery.xml");var sGallery:FileStream = new FileStream();sGallery.open(fGallery,FileMode.APPEND);sGallery.writeUTFBytes(xmlGallery.toXMLString());\[/code\]The .XML output looks like this:\[code\]<ENTRY "IMG_ID="1"/> <ENTRY "IMG_ID="2"/><ENTRY "IMG_ID="3"/>\[/code\]I need to add \[code\]<?xml version="1.0" encoding="utf-8"?>\[/code\] above the entries. How to do it?Thanks. Uli
 
Back
Top