# Shortcut?

**URL:** <https://forum.kirupa.com/t/shortcut/281712>\
**Category:** Uncategorized\
**Created:** [February 12, 2009, 3:05pm UTC](https://forum.kirupa.com/t/shortcut/281712 "2009-02-12T15:05:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![artriste](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@artriste](https://forum.kirupa.com/u/artriste)\
**Post date:** [February 12, 2009, 3:05pm UTC](https://forum.kirupa.com/t/shortcut/281712/1 "2009-02-12T15:05:53Z")

</div>

Hi,

I have a decent Flash knowledge, but I can’t seem to find a smart solution to make my code cleaner and shorter.

- I have a menu with 12 items/buttons.

- When an item is clicked, all the other turn invisible.

```auto

//////// Button 1
_root.menu.item1.onRelease = function () {
_root.menu.item2._visible = false;
_root.menu.item3._visible = false;
_root.menu.item4._visible = false;
...
_root.menu.item12._visible = false;

//////// Button 2
_root.menu.item2.onRelease = function () {
_root.menu.item1._visible = false;
_root.menu.item3._visible = false;
_root.menu.item4._visible = false;
...
_root.menu.item12._visible = false;

...and so on

```

There must be much simpler way to tell flash to turn all the buttons invisible except the clicked one? Otherwise, my approach will take a minimum of 144 lines of code!

I know you are smartter than this!
