# Grid fun

**URL:** <https://forum.kirupa.com/t/grid-fun/224697>\
**Category:** Uncategorized\
**Created:** [May 4, 2007, 2:38pm UTC](https://forum.kirupa.com/t/grid-fun/224697 "2007-05-04T14:38:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![g5604](https://avatars.discourse-cdn.com/v4/letter/g/54ee81/32.png) [@g5604](https://forum.kirupa.com/u/g5604)\
**Post date:** [May 4, 2007, 2:38pm UTC](https://forum.kirupa.com/t/grid-fun/224697/1 "2007-05-04T14:38:44Z")

</div>

Hi,

I am trying to make a map made up of lots of little dots. With the code below I create a grid of dots and then mask it with a vector world map. This actually works but sends my cpu to 100%, is there a better way to do this?

```auto

numItems = 5500;
numColumns = 100;
cnt = 1;
startX = startY=0;
padding = 1;
_root.setMask(_root.map);
for (var i = 0; i<numItems; i++) {
    this.attachMovie("dot", "dot"+i, i, {_x:startX, _y:startY});
    startX = (cnt%numColumns == 0) ? 0 : startX+this["dot"+i]._width+padding;
    startY = (cnt%numColumns == 0) ? startY+this["dot"+i]._height+padding : startY;
    cnt++;
}

```
