I NEED HELP… im trying to create an swf that will have a login page where one has to insert username and password… and it will work with multiple users using external txt files or any simplem alternative.
i saw this tutorial on the net but it keeps giving error messages… please do u have ideas how it can work or alternatives?
Dynamic Multiple Login Structure within External Txt File
// Assume AAA is the username and BBB is the password.
// Create AAA.txt in the same directory with the source file.
// Write password=“BBB” in AAA.txt and save it.
// Create two textFields and name them as username and pswd.
// Write the following code to the first frame:
username = “”;
pswd = “”;
stop ();
// Then, write the following to the second frame:
login = username +".txt";
loadVariablesNum (login, 0);
// Create two scenes for the denied and accepted users.
// Let’s say scene1 for the denied, scene2 for the accepted users.
// Code for the third frame is:
if (pswd ne password) {
gotoAndPlay (“scene1”, 1);
} else if (pswd eq password) {
gotoAndPlay (“scene2”, 1);
}
stop ();
// Code for the enter button (with a keyboard event) is:
on (release, keyPress “<Enter>”) {
if (username add pswd eq “” add “”) {
gotoAndStop (“scene2”, 1);
} else {
gotoAndPlay (“scene1”, 1);
}
}
// Now, you can test your swf with AAA as a username and BBB as
// a password, since your swf and AAA.txt are in the same directory.
// You can add more than one txt file, which means new usernames
// with new passwords without touching the source file.