# Getting object name from eventlistener

**URL:** <https://forum.kirupa.com/t/getting-object-name-from-eventlistener/259250>\
**Category:** Uncategorized\
**Created:** [May 2, 2008, 2:33pm UTC](https://forum.kirupa.com/t/getting-object-name-from-eventlistener/259250 "2008-05-02T14:33:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![greenysan](https://avatars.discourse-cdn.com/v4/letter/g/5f9b8f/32.png) [@greenysan](https://forum.kirupa.com/u/greenysan)\
**Post date:** [May 2, 2008, 2:33pm UTC](https://forum.kirupa.com/t/getting-object-name-from-eventlistener/259250/1 "2008-05-02T14:33:50Z")

</div>

hi i have currently have this frustrating problem that might be very simple but i dont get it to work for me

```auto
//square is a object that is in a array 
while (i < 25) {

square*.addEventListener(MouseEvent.CLICK,clicker);
i++
}

function clicker (evt:MouseEvent):void {
        
//i would like the the trace to output the specific array number from the the object that 
//was being clicked for example the trace would output: 23

trace(evt);

//but instead i get this [MouseEvent type="click" bubbles=true cancelable=false 
//eventPhase=3 localX=123.35 localY=126.7 stageX=585.8 stageY=519.05 
//relatedObject=null ctrlKey=false altKey=false shiftKey=false delta=0]

        }

```
