# \[fmx\] getting a variable from a movieClip name

**URL:** <https://forum.kirupa.com/t/fmx-getting-a-variable-from-a-movieclip-name/100343>\
**Category:** Uncategorized\
**Created:** [January 28, 2004, 12:30pm UTC](https://forum.kirupa.com/t/fmx-getting-a-variable-from-a-movieclip-name/100343 "2004-01-28T12:30:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![theMonitor](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@theMonitor](https://forum.kirupa.com/u/theMonitor)\
**Post date:** [January 28, 2004, 12:30pm UTC](https://forum.kirupa.com/t/fmx-getting-a-variable-from-a-movieclip-name/100343/1 "2004-01-28T12:30:14Z")

</div>

can anyone please tell me, what’s the best way to get a variable when a button or movie clip is clicked that corresponds to a part of the name of the clip?

let me explain…

say i have four movie clips, clip01, clip02, clip03 and clip04.

```auto

for(i=1; i<5; i++) {
_root["clip"+i].onRelease = function() {
// set variable 'clipClicked' to 1, 2, 3 or 4
}
}

```

thanks in advance…

||| O ^ | + O ¬
