读取缓存:
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();