# Assigning string to movieclip name then calling it

**URL:** <https://forum.kirupa.com/t/assigning-string-to-movieclip-name-then-calling-it/316746>\
**Category:** Uncategorized\
**Created:** [December 1, 2010, 1:05pm UTC](https://forum.kirupa.com/t/assigning-string-to-movieclip-name-then-calling-it/316746 "2010-12-01T13:05:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tlhood1080](https://avatars.discourse-cdn.com/v4/letter/t/e19adc/32.png) [@tlhood1080](https://forum.kirupa.com/u/tlhood1080)\
**Post date:** [December 1, 2010, 1:05pm UTC](https://forum.kirupa.com/t/assigning-string-to-movieclip-name-then-calling-it/316746/1 "2010-12-01T13:05:21Z")

</div>

So I’m having trouble calling my movieclips that I created and assigned strings to their names.

So I’m trying to create 3 movieclips with 3 different instances and add them to the stage.

here’s the code:

for(var i:int = 3; i \> 0; i–){  
var myMC:MovieClip = new MovieClip();  
var myMCName:String = “MCName”+String(i);  
myMC.name = myMCName;  
trace(myMC.name);  
addChild(myMCName);  
}

it all worked even up to the trace statement giving MCName1, MCName2 and MCName3

but myMCName is a string and it wont let me call the movieclip like that.

any suggestions without using “MCName1”, “MCName2” or “MCName3” as i can get large.

Thanks.
