# Using an array to check for button press

**URL:** <https://forum.kirupa.com/t/using-an-array-to-check-for-button-press/152015>\
**Category:** flash\
**Created:** [June 20, 2005, 4:14pm UTC](https://forum.kirupa.com/t/using-an-array-to-check-for-button-press/152015 "2005-06-20T16:14:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kirk\_netiq](https://avatars.discourse-cdn.com/v4/letter/k/ee59a6/32.png) [@kirk\_netiq](https://forum.kirupa.com/u/kirk_netiq)\
**Post date:** [June 20, 2005, 4:14pm UTC](https://forum.kirupa.com/t/using-an-array-to-check-for-button-press/152015/1 "2005-06-20T16:14:13Z")

</div>

I have six buttons on a frame. When a user presses a button they are sent to a new frame with information - then they click another button and return to the first frame with the six buttons. I want to be able to check that each button has been pressed, and if it has, I want to set the alpha (since they are MC’s) set to 50%. I have done some research on this and have found that using an array is helpful. But how would I set this up?

buttons = [“btn1”, “btn2”, “btn3”, “btn4”, “btn5”, “btn6”];

But what AS would I use to check which button is pressed and where whould I put this code…on the first frame?

Thanks

Kirk
