Custom Search

Tuesday, December 11, 2007

Basic Flash Password Protection part 3,4

Part 3

Once you have the password input screen, you’ll need another screen to display if they enter the incorrect password. On a separate frame from your password input screen, copy all of your graphics, etc. and then add text telling the user (in whatever words you choose, but let’s try to behave here) that they’ve entered the wrong password. Then create a “Try Again” button; this can be a graphic or text, whatever you choose.

Part 4

Right-click the Try Again button, select Actions, and then assign the following script to the button:

on (release, keyPress “”) {
gotoAndStop(1) ;
password = “”; }

What this does is tell Flash that when the user clicks on the Try Again button or presses the Enter key, the movie should go back to frame one (the password input screen) and stop. It should also reset the value of “password” to nothing, so that it doesn’t auto-populate mistakenly with the incorrect password (or the correct one).

No comments: