# Help on Voetsjoeba's grid tut

**URL:** <https://forum.kirupa.com/t/help-on-voetsjoebas-grid-tut/39275>\
**Category:** flash\
**Created:** [January 5, 2004, 6:52pm UTC](https://forum.kirupa.com/t/help-on-voetsjoebas-grid-tut/39275 "2004-01-05T18:52:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![HuggyBear](https://avatars.discourse-cdn.com/v4/letter/h/ea5d25/32.png) [@HuggyBear](https://forum.kirupa.com/u/HuggyBear)\
**Post date:** [January 5, 2004, 6:52pm UTC](https://forum.kirupa.com/t/help-on-voetsjoebas-grid-tut/39275/1 "2004-01-05T18:52:49Z")

</div>

Hey,

Voetsjoeba’s grid tut worked like a charm, but I’m having a hell of a time figuring out how to speed up the grid…

Anyone already had this problem or know how to speed it up?

[AS]//Declare variables  
xspacing = box.\_width;  
yspacing = box.\_height;  
depth = 0;  
box.\_visible = 0;  
azcount = 0;  
smoothness = 100;

//Calculate positions and values  
amH = Math.ceil(image.\_width/box.\_width);  
amV = Math.ceil(image.\_height/box.\_height);  
border.\_height = image.\_height+1;  
border.\_width = image.\_width+1;  
border.\_x = image.\_x-0.5;  
border.\_y = image.\_y-0.5;

//Create grid  
for (var k = 0; k\<amV; k++) {  
for (i=0; i\<amH; i++) {  
box.duplicateMovieClip(“box”+depth, depth);  
cur = this[“box”+depth];  
cur.\_x = image.\_x+(xspacing_i);  
cur.\_y = image.\_y+(yspacing_k);  
depth++;  
}  
}  
//  
//  
// End of grid

function fadeOut(startboxnr, speed) {  
fadeMC(startboxnr, speed);  
}  
function fadeMC(mcnr, speed) {  
azcount++;  
\_root[“box”+mcnr].onEnterFrame = function() {  
\_root[“box”+mcnr].\_alpha -= speed;  
if (\_root[“box”+mcnr].\_alpha\<=smoothness) {  
\_root[“box”+mcnr].onEnterFrame = null;  
continueFade(\_root[“box”+mcnr], speed);  
mcnr += 1;  
fadeOut(mcnr, speed);  
}  
};  
}  
function continueFade(mc, speed) {  
mc.onEnterFrame = function() {  
mc.\_alpha -= speed;  
if (mc.\_alpha\<=0) {  
delete mc.onEnterFrame;  
}  
};  
}  
fadeOut(0, 3);[/AS]
