Password Verification using Actionscript

 

First of all you'll need an 'input box' if you just want a password verified. Two if you want to verify a username and a password.

Next you'll need to set one of the 'input boxes' var = password

Next create a button.

Now open the actions window and set the button using this code:

on (release)

password = password.toLowerCase ();

if(password =="your password here")
gotoandplay(2)

}

what this does is if the password entered into the password input box matches "your password here" then it will proceed to where ever you wanted, I put "current scene, Frame 2". You can set the same thing up if you wanted to have flash verify the username as well,

on (release)

username = username.toLowerCase ();

if(username =="your username")
gotoandplay(3)

password = password.toLowerCase ();

if(password =="your password here")
gotoandplay(2)

//you can also put in this if you wanted to redirect the user with the incorrect password to a "declined password" area.:

else {gotoandplay(5)}

One thing you must remember is that when you enter your password in the actionscript you must have it all be lowercase, if you don't want all the be lower case, omit the ".toLowerCase ()" on both lines. This will require the user to enter in the password in case sensitive format.

 

 

Created by dpurcell @ www.ravedp50.com

Hosted by www.Geocities.ws

1