这么简单的问题而不是经过大量搜索后的答案......是否可以这样做?以及如何在loadXML函数中获取saveData函数的值?到目前为止我做了:
public function saveData(name:String,date:Date,email:String,videoName:String,thumbName:String,comments:String):void{
var myLoader:URLLoader = new URLLoader();
myLoader.load(new URLRequest("assets/recordings.xml"));
myLoader.addEventListener(Event.COMPLETE, loadXML);
}
private function loadXML(e:Event):void {
xmlFile = new XML(e.target.data);
xmlFile.prependChild(<recording>
<name>test</name>//??how to get the above values into this node
<email>test</email>
<date>test</date>
<filename>test</filename>
<thumb>test</thumb>
<commentst>test</comments>
</recording>);
//how to write the xmlFile xml object to recordings.xml, thus updating it???
}
提前致谢!