# How to tell which instance i am in?

**URL:** <https://forum.kirupa.com/t/how-to-tell-which-instance-i-am-in/260827>\
**Category:** Uncategorized\
**Created:** [May 20, 2008, 9:55am UTC](https://forum.kirupa.com/t/how-to-tell-which-instance-i-am-in/260827 "2008-05-20T09:55:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nlween](https://avatars.discourse-cdn.com/v4/letter/n/ac91a4/32.png) [@nlween](https://forum.kirupa.com/u/nlween)\
**Post date:** [May 20, 2008, 9:55am UTC](https://forum.kirupa.com/t/how-to-tell-which-instance-i-am-in/260827/1 "2008-05-20T09:55:07Z")

</div>

In my project i create a grid of 100 squares dynamically through actionscript using something like:

\_root.createEmptyMovieClip(“allGrid”, 1);  
var newBox:MovieClip = allGrid.attachMovie(“box”, “box”+count, count);

so it names the 100 squares box1 to box100. when i roll over one of the squares, how do i tell which instance i am rolling over?

i.e.  
if inside the mc i put:

this.onRollOver = function(){}

how do i tell which instance “this” is?

---

<div class="post-metadata">

**Author:** ![randomagain](https://avatars.discourse-cdn.com/v4/letter/r/35a633/32.png) [@randomagain](https://forum.kirupa.com/u/randomagain)\
**Post date:** [May 20, 2008, 9:57am UTC](https://forum.kirupa.com/t/how-to-tell-which-instance-i-am-in/260827/2 "2008-05-20T09:57:52Z")

</div>

trace(this)

---

<div class="post-metadata">

**Author:** ![nlween](https://avatars.discourse-cdn.com/v4/letter/n/ac91a4/32.png) [@nlween](https://forum.kirupa.com/u/nlween)\
**Post date:** [May 20, 2008, 10:00am UTC](https://forum.kirupa.com/t/how-to-tell-which-instance-i-am-in/260827/3 "2008-05-20T10:00:10Z")

</div>

well i want to use that information elsewhere in the program though, like show the coordinates in a textbox over on the side when i roll over a square.

how do i pass the name of that instance that i am in to somewhere else in the program?
