我正在创建一个游戏,我正在使用sharedobject来保存数据。我想让玩家选择保存文件的位置。有没有办法使用filereference来实现这一目标?
以下是代码示例:
import flash.net.SharedObject;
var saveDataObject:SharedObject;
saveDataObject = SharedObject.getLocal("savedata");
var playerHealth:Number = 10;
var playerStamina:Number = 4;
var playerCash:Number = 4;
//Save Function
function saveData(e:MouseEvent):void{
saveDataObject.data.savedPlayerHealth = playerHealth;
saveDataObject.data.savedPlayerStamina = playerStamina;
saveDataObject.data.savedPlayerCash = playerCash;
saveDataObject.flush();
}
//Load Function
function loadData(e:MouseEvent):void{
playerHealth = saveDataObject.data.savedPlayerHealth;
playerStamina = saveDataObject.data.savedPlayerStamina;
playerCash = saveDataObject.data.savedPlayerCash;
}