更新时间:2023-02-02 21:36:03
SharedObject类应该做的罚款你。你写的属性/读取可以是任何类型(字符串,数组,数字,布尔值,XML,...)。
The SharedObject class should do fine for you. The attributes you write/read can be of any type (String, Array, Number, Boolean, XML, ...).
基本例如:
var scores : Array = new Array(10, 20, 30);
var my_so : SharedObject = SharedObject.getLocal("myGameHighscore");
my_so.data.scores = scores; // set scores var to data object of SharedObject
my_so.flush(); // writes the data instantly
// To retreive your scores simply use getLocal again and then do something like:
trace(my_so.data.scores[0]); // will trace first element of scores array "10"
请参考这个网址:http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/SharedObject.html