# Using For Loops to insert Movie Clips

**URL:** <https://forum.kirupa.com/t/using-for-loops-to-insert-movie-clips/299912>\
**Category:** Uncategorized\
**Created:** [November 12, 2009, 2:56pm UTC](https://forum.kirupa.com/t/using-for-loops-to-insert-movie-clips/299912 "2009-11-12T14:56:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kdteacher](https://avatars.discourse-cdn.com/v4/letter/k/a9adbd/32.png) [@kdteacher](https://forum.kirupa.com/u/kdteacher)\
**Post date:** [November 12, 2009, 2:56pm UTC](https://forum.kirupa.com/t/using-for-loops-to-insert-movie-clips/299912/1 "2009-11-12T14:56:53Z")

</div>

I am still new to AS3.

I have four (at some point a lot more) unique movie clips that I have set the properties for exporting using actionscript.

I would like to place these movieclips on the stage using a “for loop”.

Here’s the code I have attempted, but AS3 doesn’t like. The code that is commented out works, but I don’t want to have to write lines upon lines of code.

I have also attached the file I am working with.

[INDENT]import flash.utils.\*;

var myClip=new Array(4);

for (var i:int=0; i\<4; i++) {  
myClip\*=addChild(new “a”+i());  
}

//myClip[0]=addChild(new a0());  
//myClip[1]=addChild(new a1());  
//myClip[2]=addChild(new a2());  
//myClip[3]=addChild(new a3());

[/INDENT]

thanks in advance

M I K E
