随笔-295  评论-26  文章-1  trackbacks-0

创建对象并写入信息:
import flash.net.SharedObject;
var items_array:Array = new Array(101, 346, 483);
var currentUserIsAdmin:Boolean = true;
var currentUserName:String = "Ramona";

var my_so:SharedObject = SharedObject.getLocal("superfoo","/",false);
my_so.data.itemNumbers = items_array;
my_so.data.adminPrivileges = currentUserIsAdmin;
my_so.data.userName = currentUserName;
my_so.flush(1000);
for (var prop in my_so.data) {
    trace(prop+": "+my_so.data[prop]);
}

写在另外一个FLA文件中,读取信息:
import flash.net.SharedObject;
var my_so:SharedObject = SharedObject.getLocal("superfoo","/",false);

for (var prop in my_so.data) {
trace(prop+": "+my_so.data[prop]);
}

文件保存到:
C:\Documents and Settings\jianglang317\Application Data\Macromedia\Flash Player\#SharedObjects\FXHMK25Q\localhost



大盘预测 国富论
posted on 2008-10-23 15:23 华梦行 阅读(784) 评论(1)  编辑  收藏

评论:
# re: FLASH sharedObject 写入文件信息 相当与cookies[未登录] 2008-11-28 16:29 |
flash帮助文档  回复  更多评论
  

只有注册用户登录后才能发表评论。


网站导航: