Набросок

Код:
import flash.display.BitmapData;
import flash.geom.*;
//// сама функция
function mosaic (mcDraw:MovieClip, mcIn:MovieClip, mcOut:MovieClip, cellSize:Number) {
cellSize = Math.floor (cellSize);
if (cellSize > 0) {
bmp.fillRect (bmp.rectangle, 0x00000000);
mcOut._xscale = mcOut._yscale = 100;
mcIn._xscale = mcIn._yscale = 100 / cellSize;
bmp.draw (mcDraw);
mcOut._xscale = mcOut._yscale = 100 * cellSize;
mcIn._xscale = mcIn._yscale = 100;
}
}
//// объекты
var bmp:BitmapData = new BitmapData (200, 200, true, 0x0);
var mc:MovieClip = this.createEmptyMovieClip ("mc", this.getNextHighestDepth ());
var mcImage:MovieClip = this.createEmptyMovieClip ("mcI", this.getNextHighestDepth ());
var mcGradient:MovieClip = mcImage.createEmptyMovieClip ("mc", 0);
//// вспомогательная ерунда
mc.attachBitmap (bmp, 0);
mcI._x = mcI._y = 100;
mc._x = 400;
mc._y = 100;
with (mcGradient) {
colors = [0x000000, 0xFF0000];
fillType = "linear";
alphas = [100, 100];
ratios = [0, 0xFF];
matrix = new Matrix ();
matrix.createGradientBox (200, 200, Math.PI / 4, 0, 0);
beginGradientFill (fillType, colors, alphas, ratios, matrix);
moveTo (0, 0);
lineTo (0, 200);
lineTo (200, 200);
lineTo (200, 0);
lineTo (0, 0);
endFill ();
}
//// вызываем функцию
var cx:Number = 1;
setInterval(function () {
mosaic (mcImage, mcGradient, mc, cx++);
}, 500);
mosaic (mcImage, mcGradient, mc, cx++);