Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

password login/user input in any order as long as numbers are correct

Status
Not open for further replies.

Flashoid

Technical User
Dec 11, 2002
163
US
Is it possible to create a password login where as you have 6 numbers as the correct login (example: 633456) but the user can enter them in any order and it allows access? (for example they key in 334566 and it allows access)

...any input/suggestions would be great.

possible to add if/else statements to this password approach?:
on (release) {
if (password == "123456") {
nextFrame();
} else {
gotoAndStop(3);
}
}



or maybe adding a series of if/else's with this approach?:
on (release) {
total = Number(firstnumber) + Number(secondnumber) + Number(thirdnumber) + Number(fourthnumber) + Number(fifthnumber);
this.box._visible = false;
gotoAndStop("one");



}


thanks!
 
thats not going to be easy though theres hundreds of combinations possible so if/else statements would be quite large.

If the numbers were unique and no duplicates involved such as the 33 and 66 in your example then you could just do two loops

Loop1 taking the value from char position x of the entered value
Loop2 checking it against each of the char positions in the compared password.
End Loop2
End Loop1

What I dont understand is why you would want to do this for passwords?
 
could I just take the sum total of the password (ex: 123456 = 21) and if the numbers the user enters in equal that sum total (21) then the login works?

 
yes if the numbers are unique but if not then that would also mean 436233, 771114 etc etc would also be valid.
 
peasepud --

I am building a simple game whereas the user enters 6 different screens (mini-interactions) and at the end of each of those screens they are given one number (one number for a 6 digit login code). After getting through all 6 screens the user has to enter in the 6 digit code. The way it is built I need to allow the user to enter the login code in any order.

I was thinking that if the login actionscript had an input field that calculated the sum total of their entry and it equaled the correct number it would work - this would avoid having all the if/else statements.
 
yes if the numbers are unique but if not then that would also mean 436233, 771114 etc etc would also be valid.

I could live with that - if I could get it to work so the sum total equalled a particular number (the user will be unaware of this and they would need to get lucky to inadvertantly enter in the correct number) I think it would still work effectively enough. I think most users for this will follow the directions and enter in the correct numbers.
 
Can I just ask though.

Why? unless (and no offence meant to anyone here) you are developing a site for the number dyslexia society why would you want to allow such a thing?
 
hard to explain but since the user's path is unknown (they can enter any of the 6 screens they wish) and I am trying to make this as user friendly as possible - I want to allow the user to enter in the password (numerical password that is) in any order. this would be an easy way to simplify what otherwise would be very lengthy instructions to the user.

I can simply say "enter all 6 screens in any order and write down the numeric code at the end of each screen - you will need to enter these codes in after you've completed all 6 screens". vs. asking them to also write down what number goes in what order, etc...

 
I found a solution -- I just modified a simple calculator so if the user input sum total is equal to the sum total of the password it plays a MC - the user will be oblivious to how it's actually working. I know this is bewildering to you but it will work for my needs. thanks


stop();
if(total == 10){
tellTarget ("correct") {
nextFrame(); }
} else if(total > 10){
tellTarget ("incorrect") {
nextFrame(); }
} else if(total < 10){
tellTarget ("incorrect") {
nextFrame(); }
}
 
ahh but now you've explained it, basically its not a password as such but a way of verifying they've done all six screens?

Makes total sense now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top