# Else/if question

**URL:** https://forum.kirupa.com/t/else-if-question/2639
**Category:** Uncategorized
**Created:** [April 1, 2002, 1:15am UTC](https://forum.kirupa.com/t/else-if-question/2639 "2002-04-01T01:15:08Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 1, 2002, 1:15am UTC](https://forum.kirupa.com/t/else-if-question/2639/1 "2002-04-01T01:15:08Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 1, 2002, 1:47am UTC](https://forum.kirupa.com/t/else-if-question/2639/2 "2002-04-01T01:47:17Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 1, 2002, 2:21am UTC](https://forum.kirupa.com/t/else-if-question/2639/3 "2002-04-01T02:21:21Z")

</div>

ok thanx \r_P_L_U_R\*

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 1, 2002, 2:23am UTC](https://forum.kirupa.com/t/else-if-question/2639/4 "2002-04-01T02:23:42Z")

</div>

what would the code look like?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 1, 2002, 2:44am UTC](https://forum.kirupa.com/t/else-if-question/2639/5 "2002-04-01T02:44:30Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [April 1, 2002, 2:49am UTC](https://forum.kirupa.com/t/else-if-question/2639/6 "2002-04-01T02:49:43Z")

</div>

i’m eternally grateful ajajja

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 19, 2002, 5:35pm UTC](https://forum.kirupa.com/t/else-if-question/2639/7 "2002-05-19T17:35:43Z")

</div>

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 !

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 19, 2002, 5:43pm UTC](https://forum.kirupa.com/t/else-if-question/2639/8 "2002-05-19T17:43:25Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 19, 2002, 6:29pm UTC](https://forum.kirupa.com/t/else-if-question/2639/9 "2002-05-19T18:29:46Z")

</div>

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

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 19, 2002, 6:31pm UTC](https://forum.kirupa.com/t/else-if-question/2639/10 "2002-05-19T18:31:24Z")

</div>

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 ?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 19, 2002, 7:34pm UTC](https://forum.kirupa.com/t/else-if-question/2639/11 "2002-05-19T19:34:15Z")

</div>

Use frame labels. Better.

```auto
 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]

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [May 20, 2002, 4:37pm UTC](https://forum.kirupa.com/t/else-if-question/2639/12 "2002-05-20T16:37:19Z")

</div>

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