我现在有了将多个组件文本保存到一个文件中的想法。但是现在当我打开该文件时,文件中的所有文本都只进入了一个组件的文本中。这是代码,
<s:click>
var f:File = File.desktopDirectory;
f.browseForSave("Save As");
f.addEventListener(Event.SELECT, function (event:Event):void {
var stream:FileStream = new FileStream();
stream.open((event.target as File),FileMode.WRITE);
stream.writeUTFBytes(rte.htmlText);
stream.writeUTFBytes(ta.text);
stream.writeUTFBytes(rich.text);
stream.close();
});
</s:click>
</s:Button>
<s:click>
var f:File = File.desktopDirectory;
f.browseForOpen("Select file to open", []);
f.addEventListener(Event.SELECT, function (event:Event):void {
var fs:FileStream = new FileStream();
fs.open(event.target as File, FileMode.READ);
rte.htmlText = fs.readUTFBytes(fs.bytesAvailable);
ta.text = fs.readUTFBytes(fs.bytesAvailable);
fs.close();
});
</s:click>
</s:Button>
一些建议?