以下代碼只讀取文件而不是寫入文件。我使用Flash Player而不是Air,代碼必須將數據保存到外部網站,以便FileReference和FileStream不起作用。AS3寫入文件
var Update:URLRequest = new URLRequest("http://freememegames.com/wp-content/uploads/highscore.txt");
var Score:URLVariables = new URLVariables();
var Load:URLLoader = new URLLoader();
Update.method = URLRequestMethod.POST;
Score.Name = "Jack";
Score.Value = "100";
Update.data = Score;
Load.load(Update);
Load.addEventListener(Event.COMPLETE, Complete);
function Complete(e:Event):void {
scores.text = String(e.target.data);
}
據我所知,'FileReference' ** does **允許您上傳和下載文件到遠程服務器。請糾正我? – amn
用戶在選擇文件時必須瀏覽到該位置,並且該文件只能保存在客戶端的PC上。 – user2497990
因此,該文件只能保存在客戶端PC或外部網站上?你是自相矛盾的。 – amn