2015-05-19 56 views
0

有沒有一種方法可以實際上將其保存爲XML文件本身,然後分別讀入閃存文件?使用AS3保存XML文件

var book:XML = <book/>; 
book.publisher = <publisher/>; 
[email protected] ="O'Reilly"; 

book.title = "Learning ActionScript 3.0"; 

book.appendChild(<subject/>); 
book.subject.prependChild("Action Script"); 
book.insertChildAfter(book.subject, <authors/>); 

book.authors.author.firstname = "Zevan"; 
book.authors.author.lastname = "Rosser"; 

var tempList:XMLList = book.authors.author.copy() 
tempList[0].firstname = "Rich" 
tempList[0].lastname = "Shupe" 
book.authors.insertChildBefore(book.authors.author, tempList); 

trace (book); 
+0

什麼是平臺?空氣?瀏覽器? – BadFeelingAboutThis

回答

0

有一個辦法,其實還有已經在那了堆棧溢出和足夠的答案的問題,你可以檢查:Flash Actionscript 3 saving a XML file locally has a "Save As" window (How can I remove it?)。 任何方式,你可以使用空氣作爲閃存有一個圖書館,這將有助於您將文件保存爲一個後臺進程做到這一點,你可以找到你需要在這裏的所有信息:http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/File.html

+0

鏈接只有StackOverflow上的答案是皺眉。如果您覺得問題是重複的,請將其標記爲此,並留下評論,指出該人對該問題的答案。 – BadFeelingAboutThis

0

您可以將此保存爲xml。並讀入閃存。將其存儲在本地並使用共享對象。檢查this link以供參考。

+0

鏈接只有StackOverflow上的答案是皺眉。如果您唯一可以貢獻的是鏈接,請將其作爲評論或作爲真實答案的參考。否則,通過提供示例使您的答案更有用。 – BadFeelingAboutThis

+0

@LDMS在編輯之前,我已經給了一個特殊的鏈接,但是下一次我會考慮下一次:) –