Creating a matrix of squares with a for loop

ok. I have a tricky question although the solution is likely staring me right in the face.

I want to create a bunch of squares appear in a grid-like fashion but not row by row. I’d like more of a diagonal effect.

Here’s the code I have so far:


runCubes = function(){
        for(i=0; i<21; i++){
            this.createEmptyMovieClip("cube"+i,this.getNextHighestDepth());        
            this["cube"+i]._alpha = 0;        
            this["cube"+i].attachMovie("cube","cube",this.getNextHighestDepth());
            this["cube"+i]._y = 130;
            this["cube"+i]._x = ((this["cube"+i]._x+45) * i);        
            this["cube"+i].tween("_alpha",30,1,"easeOutQuint",0.25*i);        
        }
        for(z=0; z<11; z++){
            this.createEmptyMovieClip("cube2"+z,this.getNextHighestDepth());        
            this["cube2"+z]._alpha = 0;        
            this["cube2"+z].attachMovie("cube","cube",this.getNextHighestDepth());
            this["cube2"+z]._y = (130+((this["cube2"+z]._y+45) * z));        
            this["cube2"+z].tween("_alpha",30,1,"easeOutQuint",0.25*z);
        }    
}

So this sort of works in the sense of it creates a vertical row and a horizontal row. But I need it to actually kind of ‘wipe’ diagonally across the page.

Can anyone offer any insight?

I’m kind of thinking I need to nest that in a couple more loops but I’m getting confused as to how I should do it. Thanks in advance!