Else/if question

I saw the pasword else/if tutorial, and I was wondering, how can i make more than one password be corrct?? what if there’s other user’s besides kirupa?? \rplease answer my question by mail or something, if you think it’s too boring to do so just post your answer thanks =)\rkandykidkamaney

create an array of correct passwords and check the input against each of the passwords.\r:) \rjeremy

ok thanx \rPLUR*

what would the code look like?

if the array of correct passwords was named ‘aPasswords’ and the input variable was ‘sInput’ it might look like this:\r\r_root.zCorrect=false;\rfor(ii=0;ii<aPasswords.length;ii++){\rif(aPasswords[ii]==sInput){\r_root.zCorrect=true\rbreak;\r}\r}\rif(zCorrect){\rgotoAndPlay(“correctPass”);\r} else {\rgotoAndPlay(“incorrectPass”);\r}\r\r:) \rjeremy

i’m eternally grateful ajajja

Hi what i want to do is create an inputbox which i can do however i want to have two passwords…\r\r[Sub7]Xor0n and [Sub7]0mir0n\r\rhowever if they type in one then it will go to one frame but if they type in the other it will go to a different frame.\r\rI’ve tried just adding two if statements in but it doesnt work! \r\rAlso i want it so that if they type in something other than the two passwords then it takes them to another frame.\r\rI hope someone can help !

if (inputText == “wHaTeVeR”){\rgotoAndPlay(84)\r}else if(inputText == “wHoEvEr”){\rgotoAndPlay(76)\r}

If i just add another if field in then it comes up with an error on the debugger and wont work - if else is only if they dont enter any of the passwords i want. \r\rHope you can help me

Right yeh sorry i see how it works now - do you know how i can make it so that if they enter none of the passwords then it goes to another frame ?

Use frame labels. Better.

 if (inputText == "wHaTeVeR" ) {\r\r  gotoAndPlay ("first person" ) ;\r\r} else if(inputText == "wHoEvEr" ) {\r\r  gotoAndPlay ("second person" ) ;\r\r} else gotoAndPlay ("nobody" ) ;

pom 0]

Hi yeh thanks alot! Im always learning to learn at the tender age of 16. You have helped me alot!