flex 客户端缓存SharedObject

读取缓存:

usernameSO = SharedObject.getLocal('username');
if (usernameSO)
{
usernameSOAL = usernameSO.data['username'] as ArrayList;
if(usernameSOAL)
{
var u:Object=usernameSOAL.getItemAt(0);
username.text=u.username;
}
}

写入缓存:

var u:Object=new Object();
u.username=n;
var array:ArrayList=new ArrayList();
array.addItem(u);
usernameSO.data['username']=array;
usernameSO.flush();
上一篇:获取WebView加载的网页内容并进行动态修改


下一篇:BestCoder-Round#33