# How can you construct a movie clip name on the fly in as3?

**URL:** <https://forum.kirupa.com/t/how-can-you-construct-a-movie-clip-name-on-the-fly-in-as3/306279>\
**Category:** flash\
**Created:** [March 12, 2010, 5:55am UTC](https://forum.kirupa.com/t/how-can-you-construct-a-movie-clip-name-on-the-fly-in-as3/306279 "2010-03-12T05:55:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![The\_Deecs](https://avatars.discourse-cdn.com/v4/letter/t/a9adbd/32.png) [@The\_Deecs](https://forum.kirupa.com/u/The_Deecs)\
**Post date:** [March 12, 2010, 5:55am UTC](https://forum.kirupa.com/t/how-can-you-construct-a-movie-clip-name-on-the-fly-in-as3/306279/1 "2010-03-12T05:55:46Z")

</div>

Hi, I am new to Flash but pretty experienced in Director and lingo. Can anybody please tell how I can avoid this type of ridiculous code I am having to use:

function resetText():void {

```
pathText_textField_1.text = "";
pathText_textField_2.text = "";
pathText_textField_3.text = "";
pathText_textField_4.text = "";
pathText_textField_5.text = "";
pathText_textField_6.text = "";
pathText_textField_7.text = "";
pathText_textField_8.text = "";

```

}

In lingo I would run a repeat loop using the base “pathText\_textField\_” and adding the number as a string for each one. Is this possible in as3? I mean can I construct the mc reference using code somehow? I can of course make the names as a string in a loop but you cannot use a string as a mc name right? If not then how else can you send the same instruction to multiple mcs?

Any help would be appreciated!

Thanks
