# Alpha fade grid

**URL:** <https://forum.kirupa.com/t/alpha-fade-grid/175428>\
**Category:** contests\
**Created:** [January 14, 2006, 7:07am UTC](https://forum.kirupa.com/t/alpha-fade-grid/175428 "2006-01-14T07:07:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben\_H](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ben_h/32/939_2.png) [@Ben\_H](https://forum.kirupa.com/u/Ben_H)\
**Post date:** [January 14, 2006, 7:07am UTC](https://forum.kirupa.com/t/alpha-fade-grid/175428/1 "2006-01-14T07:07:28Z")

</div>

EDIT: Ok, final version…

```auto

stagewidth = Stage.width; // Width of your stage;
squaresrow = 16; // Number of squares in a row.
col = 0x648502; // Colour of squares.
loc = 1;
function dopx() {
al=loc;
var pos = [0,0];
for (i=0;i<(squaresrow*squaresrow);i++) {
    _root.beginFill(col,al);
    _root.moveTo(pos[0],pos[1]);
    _root.lineTo(pos[0]+(stagewidth/squaresrow),pos[1]);
    _root.lineTo(pos[0]+(stagewidth/squaresrow),pos[1]+(stagewidth/squaresrow));
    _root.lineTo(pos[0],pos[1]+(stagewidth/squaresrow));
    _root.lineTo(pos[0],pos[0]);
    al -= 100/(squaresrow*squaresrow);
    pos = [pos[0]+(stagewidth/squaresrow),pos[1]];
    if (pos[0]==stagewidth || pos[0]>stagewidth) {
        pos = [0,pos[1]+(stagewidth/squaresrow)];
    }
}
loc++;
}
onEnterFrame = function() {
    _root.clear();
    dopx();
}

```

-Ben
