flash lite as2.0 用户Cookie处理
//用户Cookie处理
function loadCookie() {
loadNick_onLoad = function (so:SharedObject) {
if (so.getSize()>0) {
_root.txbusername.text = so.data.username;
_root.txbpwd.text = so.data.pwd;
}
};
SharedObject.addListener("usercookie",loadNick_onLoad);
var so:SharedObject = SharedObject.getLocal("usercookie");
}
function saveCookie() {
var so:SharedObject = SharedObject.getLocal("usercookie");
if (chk1.selected) {
so.data.username = _root.txbusername.text;
} else {
so.data.username = "";
}
if (chk2.selected) {
so.data.pwd = _root.txbpwd.text;
} else {
so.data.pwd = "";
}
so.flush();
}