Action Script Help

I want to display sort of a grid like feature placing my movie clip say 4 columns a cross and 4 rows down.

.  .  .  .
.  .  .  .
.  .  .  .
.  .  .  .


The script I wrote only does diagonal lines...Im not an ace but I think I need to set up constraints or something to that effect....

Can someone help me out?

i = 1;
column = 5; //column spacing location
row = 5; //rows spacing location
amount = 6; // how many times to duplicate
      
                while(amount>0) {
      duplicateMovieClip ("logo", "logo" add i, 900-i);
      setProperty("logo" add i, _x, Number(column*5));
      setProperty("logo" add i, _y, Number(row*5));
      i = i + 1;
      amount = amount - 1;
      column = column + 3;
      row = row + 3;
      
}

Thanks for your help in Advance.
etterjtAsked:
Who is Participating?
 
negatyveConnect With a Mentor Commented:
var columns = 4; //column spacing location
var rows = 4; //rows spacing location
var count = 1;
for(var row = 0; row < rows; row++){
      for(var col = 0; col < columns; col++){
            var id = "logo" + count;
            logo.duplicateMovieClip(id, 900 - count);
            this[id]._x = col * 5;
            this[id]._y = row * 5;
            count++;
      }
}
0
 
etterjtAuthor Commented:
thanks.  I now understand the logic.  A+
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.