# Store instance name of btn pressed in variable?

**URL:** https://forum.kirupa.com/t/store-instance-name-of-btn-pressed-in-variable/178818
**Category:** Uncategorized
**Created:** [February 14, 2006, 3:23pm UTC](https://forum.kirupa.com/t/store-instance-name-of-btn-pressed-in-variable/178818 "2006-02-14T15:23:47Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kingman109](https://avatars.discourse-cdn.com/v4/letter/k/b5ac83/32.png) [@kingman109](https://forum.kirupa.com/u/kingman109)
#### Post date: [February 14, 2006, 3:23pm UTC](https://forum.kirupa.com/t/store-instance-name-of-btn-pressed-in-variable/178818/1 "2006-02-14T15:23:47Z")

</div>

okay… im creating 100 movie clips through duplicate movie and assigning each MC an instance name of eh\_1, eh\_2, eh\_3 etc… on rollover i would like to have have them store in a variable which button number they are.

to detect rollovers and presses, im just using

```auto
for (i=1; i<101; i++) {
_root["eh_"+i].onRollOver = function () {
};
}

```

is there anyway i can detect which button was pressed and store into a variable the number?

thanks
