# Dynamic grid Creation

**URL:** <https://forum.kirupa.com/t/dynamic-grid-creation/113910>\
**Category:** Uncategorized\
**Created:** [June 22, 2004, 10:52pm UTC](https://forum.kirupa.com/t/dynamic-grid-creation/113910 "2004-06-22T22:52:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![karmas](https://avatars.discourse-cdn.com/v4/letter/k/ec9cab/32.png) [@karmas](https://forum.kirupa.com/u/karmas)\
**Post date:** [June 22, 2004, 10:52pm UTC](https://forum.kirupa.com/t/dynamic-grid-creation/113910/1 "2004-06-22T22:52:43Z")

</div>

ok, I’m building an application and stuck in a Mathematical situation.  
I create a grid with the following actionscript :

gridx = 65;  
gridy = 65;  
num = 0;  
for (var i = 0; i\<5; i++) {  
for (var j = 0; j\<this.count; j++) {  
rec.duplicateMovieClip([color=#0000ff]“rec”[/color]+num, num);  
mc = this[[color=#0000ff]“rec”[/color]+num];  
mc.\_x = gridx_i;  
mc.\_y = gridy_j;  
num++;  
}  
}  
rec.\_visible = 0;

…where “count” is a record count I fetch from an SQL query

Now, what i want, is to duplicate the “rec” movieclip at x axis (5 times)  
and then continue at y axis (65 pixels below) duplicating till i reach the record count number.

Thank you in advance.  
John
