I’m working on a method of authentication, and i have 2 text fields named ‘username’ and ‘pass’
I want to make it so that when the user enters their username and password, that info gets stored into a text file. So when they log back in, it reads the username and password from that text file to log in.
How can I do this?
Thanks 😀
I’m working on a method of authentication, and i have 2 text fields named
Share
Saving to a text file is possible (using the File class in AIR) but this is really not a great approach. Instead you should checkout the SharedObject class
Quick example:
Once you have a handle on your sharedObject
Now to get your data back, elsewhere in the code
This object is saved locally to the users computer. It’s very similar to a browser cookie.
Now saving out a password to this object in plain text is not a good idea. A better plan would be to validate the login information on a server and store a session id of some kind in this object.
in pseudo code:
More reading:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/SharedObject.html
http://www.republicofcode.com/tutorials/flash/as3sharedobject/