# Button variables.... help, please

**URL:** <https://forum.kirupa.com/t/button-variables-help-please/258968>\
**Category:** Uncategorized\
**Created:** [April 29, 2008, 11:03pm UTC](https://forum.kirupa.com/t/button-variables-help-please/258968 "2008-04-29T23:03:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![8bit](https://avatars.discourse-cdn.com/v4/letter/8/90ced4/32.png) [@8bit](https://forum.kirupa.com/u/8bit)\
**Post date:** [April 29, 2008, 11:03pm UTC](https://forum.kirupa.com/t/button-variables-help-please/258968/1 "2008-04-29T23:03:17Z")

</div>

hello, i’m just getting started with Action Script, its very fun. Anyways, I am trying to make this memory card sort of game, and I want to (I know there could be other ways, but now I want to do it like this) make every card a button. I have like 20 button each one called button1, button2, ect… anyways, when I make the function  
this.[“button”+b].onPress = function()  
{whatever} it won’t work, i know its because it does it doesn’t know what b is, how can i make my code realize that b is just the number after the instance name for any button. I don’t know if i’m being clear, but I mean, I just want b to take the value of the button I pressed, how can I do that, since I don’t want to make the same instruction for the 20 buttons I have… hope somebody gets this, and can help me thankyou!!!
