# Dynamically create and position objects

**URL:** <https://forum.kirupa.com/t/dynamically-create-and-position-objects/180759>\
**Category:** flash\
**Created:** [March 3, 2006, 6:01am UTC](https://forum.kirupa.com/t/dynamically-create-and-position-objects/180759 "2006-03-03T06:01:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![B\_L\_U\_E](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@B\_L\_U\_E](https://forum.kirupa.com/u/B_L_U_E)\
**Post date:** [March 3, 2006, 6:01am UTC](https://forum.kirupa.com/t/dynamically-create-and-position-objects/180759/1 "2006-03-03T06:01:43Z")

</div>

I’m trying to create 49 total objects, each 50x50 px. And position them in 7 rows and 7 columns. I think I must use nested for loops but this is all Ive come up with. [AS]for(i=1;i\<=7;i++) {  
for(i2=1;i2\<=7;i2++) {  
duplicateMovieClip(\_root.tMain,“targ”+i+i2,i+i2);  
\_root[“targ”+i+i2].\_x = i \* 50;  
\_root[“targ”+i+i2].\_y = i2 \* 50;  
}  
}[/AS]
