# addChild loop

**URL:** <https://forum.kirupa.com/t/addchild-loop/311319>\
**Category:** flash\
**Created:** [July 2, 2010, 4:51pm UTC](https://forum.kirupa.com/t/addchild-loop/311319 "2010-07-02T16:51:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![frogger](https://avatars.discourse-cdn.com/v4/letter/f/9d8465/32.png) [@frogger](https://forum.kirupa.com/u/frogger)\
**Post date:** [July 2, 2010, 4:51pm UTC](https://forum.kirupa.com/t/addchild-loop/311319/1 "2010-07-02T16:51:09Z")

</div>

Hi, I am completely new to AS3 so please excuse my ignorance…

I have been trying to add multiple instances of a movie clip using the following…

function showScores() {  
var scoreID = 0;  
for (var i =0; i\<scoreData.length; i++){  
var score\_mc:MovieClip = new Score\_mc();  
score\_mc.scoreName.text = scoreData\*[0];  
score\_mc.scoreScore.text = scoreData\*[1];  
scoreBoard.addChild(score\_mc);

```
}

```

}

However only one is added. I have traced scoreData.length and get 15, I have also tried replacing it with a number - same result…

I have even tried the following in a new blank document with the same result

function showScores() {  
for (var i:Number =0; i\<11; i++){

```
    var score_mc:MovieClip = new Score_mc();    
    addChild(score_mc);
   
}

```

}

showScores();

can anyone help ☹
