# Linkage Name

**URL:** <https://forum.kirupa.com/t/linkage-name/313269>\
**Category:** flash\
**Created:** [August 25, 2010, 9:27am UTC](https://forum.kirupa.com/t/linkage-name/313269 "2010-08-25T09:27:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stii](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@stii](https://forum.kirupa.com/u/stii)\
**Post date:** [August 25, 2010, 9:27am UTC](https://forum.kirupa.com/t/linkage-name/313269/1 "2010-08-25T09:27:15Z")

</div>

Hi Folks i have a question,  
hopefully someone can shed some light

i have 10 movieclips in library with linkage name btn1 to btn10  
so i wanted to add them to stage dynamically, so i use the below for loop

for (var i:int = 0; i \< 10; i++){

var newBtn:MovieClip;  
if(i == 0){  
newBtn = new btn1();  
addChild(newBtn);  
}else if(i == 1){  
newBtn = new btn2();  
addChild(newBtn);  
}else if(i==2){  
newBtn = new btn3();  
addChild(newBtn);  
}  
//vice versa

}

just wondering are there any simpler way to do this?  
thanks in advance guys.
