# \[FMX\] Getting a duplicated movieclip's name on event

**URL:** <https://forum.kirupa.com/t/fmx-getting-a-duplicated-movieclips-name-on-event/161940>\
**Category:** flash\
**Created:** [September 8, 2005, 12:08pm UTC](https://forum.kirupa.com/t/fmx-getting-a-duplicated-movieclips-name-on-event/161940 "2005-09-08T12:08:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ildefonse](https://avatars.discourse-cdn.com/v4/letter/i/c5a1d2/32.png) [@Ildefonse](https://forum.kirupa.com/u/Ildefonse)\
**Post date:** [September 8, 2005, 12:08pm UTC](https://forum.kirupa.com/t/fmx-getting-a-duplicated-movieclips-name-on-event/161940/1 "2005-09-08T12:08:01Z")

</div>

Hi all,

Normally I don’t bother posting a question which seems as trivial as mine, because usually Google or some forums / tutorial sites are my best friend.

However, I cannot find a solution \*anywhere \*for this issue. Searching the forum yields: “The following words are either very common, too long, or too short and were not included in your search: **name** ”

Anyway, the thing is this.

I duplicate a movieclip several times, which is a button, and name the instances c0, c1, c2, etc. I want to use substring to extract the number behind this name when someone clicks on one of these buttons. I have the following function in the button:

```auto

on(rollOver) {
			x = substring(this._name,1);
			ripples._x = coords[x].split(",")[0];
			ripples._y = coords[x].split(",")[1];
}

```

As you may guess, I need the number in the variable x. However, the pointer “this” apparently points to the level this button is on (\_level0), and not the button itself. So “this.\_name” gives me nothing.

My question to you all is, how do I obtain the buttons instance name the user has clicked on? Or for that matter, any other property. How do I address the button itself, from the on(XXXX) function?

The code to spawn the buttons is (in a loop):

```auto

	duplicateMovieClip("clickdot","c"+x,x+10);
	setProperty("c"+x,_x,coords[x].split(",")[0]-8);
	setProperty("c"+x,_y,coords[x].split(",")[1]-8);

```

Obtaining the coordinates instead of it’s name would suffice as well.

Thanks for any help you can offer.
