Shortcut?

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.



//////// 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!