# Controlling clips created dynamically with loops

**URL:** <https://forum.kirupa.com/t/controlling-clips-created-dynamically-with-loops/191260>\
**Category:** Uncategorized\
**Created:** [June 19, 2006, 5:12am UTC](https://forum.kirupa.com/t/controlling-clips-created-dynamically-with-loops/191260 "2006-06-19T05:12:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![frankf](https://avatars.discourse-cdn.com/v4/letter/f/e274bd/32.png) [@frankf](https://forum.kirupa.com/u/frankf)\
**Post date:** [June 19, 2006, 5:12am UTC](https://forum.kirupa.com/t/controlling-clips-created-dynamically-with-loops/191260/1 "2006-06-19T05:12:25Z")

</div>

hello

i was wondering how to make a grid of squares with loops? also, how do i controle the clips that were dynamically created with the loop. like clip25 only?

```auto
 
total = 5;
i = 1;
while(i<total){
        
        //create MovieClip with new name
        mcName = this.createEmptyMovieClip("square_mc"+i, this.getNextHighestDepth());
        
        //begin fill in each new MovieClip
        mcName.beginFill(0xFF0000);
        mcName.moveTo(10, 10);
        mcName.lineTo(100, 10);
        mcName.lineTo(100, 100);
        mcName.lineTo(10, 100);
        mcName.lineTo(10, 10);
        mcName.endFill();                                                                                                                                                                                                                                                             
        
        // how do i place the clips here? also how do i make certain clips
       //move with action script?
        mcName._x = mcName.width
        mcName._y = mcName.height
        
        //count
        i++;
}

```

thanks so much for your help
