# Instance names in array?

**URL:** <https://forum.kirupa.com/t/instance-names-in-array/328102>\
**Category:** Uncategorized\
**Created:** [April 19, 2012, 5:31am UTC](https://forum.kirupa.com/t/instance-names-in-array/328102 "2012-04-19T05:31:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![GeekTweak\_0](https://avatars.discourse-cdn.com/v4/letter/g/b5ac83/32.png) [@GeekTweak\_0](https://forum.kirupa.com/u/GeekTweak_0)\
**Post date:** [April 19, 2012, 5:31am UTC](https://forum.kirupa.com/t/instance-names-in-array/328102/1 "2012-04-19T05:31:15Z")

</div>

I have a bunch of buttons on stage, and i want to place all of those buttons names in an array so i can assign an event listener to them easier. What i have is:

```auto
var btnArray = new Array["btn1","btn2","btn3","etc...."];

for(var c=0; c<btnArray.length; c++)
{
    btnArray[c].addEventListener(MouseEvent.MOUSE_OVER, doSomething);
}

```

But that isnt working. Is there a good way to go about this?

Thanks.
