# How to optimize code for menu?

**URL:** <https://forum.kirupa.com/t/how-to-optimize-code-for-menu/134330>\
**Category:** Uncategorized\
**Created:** [January 17, 2005, 9:16pm UTC](https://forum.kirupa.com/t/how-to-optimize-code-for-menu/134330 "2005-01-17T21:16:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kathari](https://avatars.discourse-cdn.com/v4/letter/k/a183cd/32.png) [@kathari](https://forum.kirupa.com/u/kathari)\
**Post date:** [January 17, 2005, 9:16pm UTC](https://forum.kirupa.com/t/how-to-optimize-code-for-menu/134330/1 "2005-01-17T21:16:07Z")

</div>

Hi,  
this is probably a silly question but I can’t seem to find any tutorials on this specific thing anywhere (probably too easy…)  
I have a bunch of menu-items(subheadings) that change color in their up, over and down states. I suppose one should be able to use arrays in order to avoid writing code to (if needed) change the menu-items that are NOT pressed to their up-states. I hope I am making myself clear. I have tried different ways but I am probably just not going the right direction…  
If anyone can help or know where to find a tutorial I’ll be really happy :te:
