• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 183
  • Last Modified:

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.
0
etterjt
Asked:
etterjt
1 Solution
 
negatyveCommented:
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now