Now all that is left is the Submit button. Select it and right click and select Actions, and type in the following:
on (release, keyPress "") { notes = ""; password = password; username = username; if (username == "user" && password == "user password") { gotoAndPlay ("Scene 2", 2); } else if (username == "user2" && password == "user2 password") { gotoAndPlay ("Scene 2", 2); } else { notes = "Error: Invalid Username or Password"; username = ""; password = ""; } }
If you want only 1 person to access it, remove the:
else if (username == "user2" && password == "user2 password") {
gotoAndPlay ("Scene 3", 2);
}
part. If you want many users, continue to add more else if commands.
Change user and user2 into the usernames, and user password and user2 password into the passwords for them. Both are case sensitive, and both can allow almost any character (Including space), except (with a comma seperating them, comma's are also in the list though) ',",:,;,{,},(,),<,>,-,+,=, and all the keys you get with Shift and a number.
You can even make them goto different places by changing the scene name, but always make it frame 2, and set frame 1 of each scene after the password to:
gotoAndPlay ("Scene 1", 1); where Scene 1 is the scene this is on.
| » Level Intermediate |
|
Added: 2003-07-28 Rating: 2.97 Votes: 63 |
| » Author |
| I am a 15 year old Southern Californian that is new to web designing and I have learned A LOT of flash in 1 month =\. |
| » Download |
| Download the files used in this tutorial. |
| Download (152 kb) |
| » Forums |
| More help? Search our boards for quick answers! |
-
You must have javascript enabled in order to post comments.


Comments
There are no comments yet. Be the first to comment!