首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

利用SharedObjects保留信息

2012-08-26 
利用SharedObjects保存信息??????? flash没有像html的cookies,但是通过SharedObjects可以实现类似的功能。?

利用SharedObjects保存信息

??????? flash没有像html的cookies,但是通过SharedObjects可以实现类似的功能。

?

??????? 创建SharedObjects并保存用户名称

???????

//create a shared object to store the user name this line actually//specifies the file name (userFile), it will have an extension of .sol ...var so:SharedObject = SharedObject.getLocal("userFile");//create and populate a userLoginName property for the shared object...so.data.userLoginName = txtUserLoginName.text;//write the file to the users disk...so.flush();

?

??? 从SharedObjects中读取数据

?

??

var so:SharedObject = SharedObject.getLocal("userFile");if(so.data.userLoginName != undefined){    this.txtUserLoginName.text = so.data.userLoginName;    this.txtPassword.setFocus();}

?

?

? 删除SharedObjects中的信息

?

?

??

so.clear();so.flush();

?

?

热点排行