AIR 本地文件读写
//写文件
var testXML:XML =<iteye><site>huyuguo.iteye.com</site><blog>huyuguo</blog></iteye>;
var file:File = File.documentsDirectory.resolvePath("test.xml");
var fileStream:FileStream = new FileStream();
fileStream.open(file, FileMode.WRITE);
var outputString:String = '<?xml version="1.0" encoding="utf-8"?>\n';
outputString += testXML.toXMLString();
fileStream.writeUTFBytes(outputString);
fileStream.close();
//读文件
var testXML:XML;
var file:File = File.applicationDirectory.resolvePath("test.xml");
var fileStream:FileStream = new FileStream();
fileStream.open(file, FileMode.READ);
testXML = XML(fileStream.readUTFBytes(fileStream.bytesAvailable));
fileStream.close();