Please help with this advanced transition

Hey everyone,
There is an effect i have seen on so many websites, an example of it is http://www.hanasushi.pl/ (when you click one of the buttons its the transition between backgrounds, the expanding squares mask) Anyway, I have searched every forum i know trying to find an understandable eplanation of how this is done but to no avail.

I have managed to create the animation using actionscript with row delay here is a bit of a test i did to make sure i could make the movement by code http://jon-burke.com/jarrad/ani.swf . Now you may be thinking why dont i just set the layer with the animation on it as a mask and put an image below, When i do that only one of the movie clip animations masks the image, I have no idea why this is. Secondly, there must be an easier way for me to fill the area with these squares than one by one coding their movement, If i code one by one ill have over 50 lines of code for simple animaton. Im guessing an array might be the way to go.

Anyway if someone could please help me with this it would be much appreciated.

Thankyou