# Menu Help

**URL:** <https://forum.kirupa.com/t/menu-help/20760>\
**Category:** Uncategorized\
**Created:** [May 13, 2003, 5:27am UTC](https://forum.kirupa.com/t/menu-help/20760 "2003-05-13T05:27:00Z")\
**Posts on this page:** 9\
**Page:** 3

<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 15, 2003, 8:32pm UTC](https://forum.kirupa.com/t/menu-help/20760/41 "2003-05-15T20:32:17Z")

</div>

Did you do the if else statement?

You have the if statement, but you haven’t showed me the else statement.

So far what you showed me was if j is equal to 5 then set button5’s label to “X”. But what if it isn’t equal to 5? That is where the else statement comes into play.

[AS]if (statement){  
//do this  
} else {  
//do this  
}[/AS]

---

<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 15, 2003, 8:47pm UTC](https://forum.kirupa.com/t/menu-help/20760/42 "2003-05-15T20:47:54Z")

</div>

This is where I get confused at, I have tried a few things, this would be easier if u get on AIM, I can IM you and we can stop taking up the forums :o

---

<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 15, 2003, 9:20pm UTC](https://forum.kirupa.com/t/menu-help/20760/43 "2003-05-15T21:20:18Z")

</div>

Refer to the for loop in the script that uses the variable “i” (within the pressed prototype function) on how to target the clips correctly 😉

[edit]And I can’t come on AIM because I am usually here for short few minute bursts, not really enough time to get into helping one on one. Also it would be easier for you since you won’t have to deal with 12,043 IM windows flying at you begging for help (sometimes I regret adding my SN to my profile before).

---

<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 15, 2003, 10:01pm UTC](https://forum.kirupa.com/t/menu-help/20760/44 "2003-05-15T22:01:18Z")

</div>

bah still cant get it, and i kno its porbably so simple

---

<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 15, 2003, 10:59pm UTC](https://forum.kirupa.com/t/menu-help/20760/45 "2003-05-15T22:59:06Z")

</div>

this[“button”+j].numLabel.text = j 😉

---

<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 15, 2003, 11:30pm UTC](https://forum.kirupa.com/t/menu-help/20760/46 "2003-05-15T23:30:36Z")

</div>

ok…this is what I concluded but still see teh 5.

[AS]for (var j = 1; j\<=5; j++) {  
this[“button”+j].numLabel.text = j;  
}  
if (j == 5) {  
this.button5.numLabel.text = “X”;  
}else{  
this[“button”+j].numLabel.text = j  
}[/AS]

---

<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 16, 2003, 4:07am UTC](https://forum.kirupa.com/t/menu-help/20760/47 "2003-05-16T04:07:38Z")

</div>

::shakes head::

The if/else statement must be contained within the for loop not after the for loop. And remove the original this[“button”+j].numLabel.text = j; that is contained in the for loop now, no need to have it twice.

---

<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 16, 2003, 4:26am UTC](https://forum.kirupa.com/t/menu-help/20760/48 "2003-05-16T04:26:37Z")

</div>

Heres the final file with the true/false triggers for the rollOver effect.

I know if it took this long to do an if/else statement it will probably takes 10 times as long to explain this since its way more complex, so I left comments in the code that will hopefully allow you to better understand.

---

<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 16, 2003, 4:33am UTC](https://forum.kirupa.com/t/menu-help/20760/49 "2003-05-16T04:33:42Z")

</div>

ty very very much lol I am such a nub

[Previous page](https://forum.kirupa.com/t/menu-help/20760.md?page=2)
