This method remembers that the user name and password are cross-browser, because the file that saves the user name and password is saved in the local flash file.
Step 1: store the user name and password in the flash local file
var userInfoCookie:SharedObject = SharedObject.getLocal("userInfoCookie"); if(rememberUNAndPwd.selected) { userInfoCookie.data.userName = this.username.text; userInfoCookie.data.password = this.password.text; userInfoCookie.data.isRememberUsernameAndPassword = true; } else { userInfoCookie.data.userName = ""; userInfoCookie.data.password = ""; userInfoCookie.data.isRememberUsernameAndPassword = false; } userInfoCookie.flush();
Step 2: remove the user name and password in the flash local file and display them on the interface.
var userInfoCookie:SharedObject = SharedObject.getLocal("userInfoCookie"); if(userInfoCookie.data.hasOwnProperty("userName") && userInfoCookie.data.isRememberUsernameAndPassword && userInfoCookie.data.userName != "") { this.username.text = userInfoCookie.data.userName; this.password.text = userInfoCookie.data.password; this.rememberUNAndPwd.selected = true; }