rEd-TriggEr
New Member
I'm trying to append data to an XML file using an Adobe Air app and SAVE it.This method puts the data where I want it but it doesn't save the data;\[code\]reminder.insertChildBefore(xmlArray[0], <item> <event>{txtEvent.text}</event> <date>{dateFormatter.format(dfDate.selectedDate)}</date> <dateb>{dfDate.selectedDate.toDateString()}</dateb> <time>{formattedtime}</time> </item>);\[/code\]This method places it outside/below the \[code\]<reminder> </reminder>\[/code\] tag of the XML, it simply adds it to the end of the file. This method saves the data.\[code\]var outputString:String;outputString ="\n"+<item><event>{txtEvent.text}</event><date>{dateFormatter.format(dfDate.selectedDate)}</date><dateb>{dfDate.selectedDate.toDateString()}</dateb> <time>{formattedtime}</time></item>;outputString = outputString.replace(/\n/g, File.lineEnding);stream = new FileStream();stream.open(file, FileMode.APPEND);stream.writeUTFBytes(outputString);stream.close();\[/code\]This option would be okay but I need to get it to delete the last line from the XML and then write a new last line.Any advice on how to get either of these methods to work correctly would be very much appreciated.