用FLASH做马赛克效果

      FLASH 2005-6-21 19:42
用FLASH做马赛克效果:

Flash 动画

主要代码:
n = 0;
a = [];
m = 0;
for (var i = 0; i<20; i++) {
    for (var j = 0; j<20; j++) {
        var dot = attachMovie("dot", "dot"+n, n);
        dot._x = dot._width*i;
        dot._y = dot._height*j;
        n++;
    }
}
for (var i = 0; i<20*20; i++) {
    a[i] = _root["dot"+i];
}
onEnterFrame = function () {
    for (var i = 0; i<20*20; i++) {
        m++;
        if (m%12== 0) {
            var rand = random(a.length-1);
            var t_mc = a[rand];
            a[rand] = a[a.length-1];
            a.pop();
            t_mc.gotoAndPlay(2);
        }
    }
    if (a.length == 0) {
        delete (m);
    }
};

标签集:TAGS:
回复Comments() 点击Count()

回复Comments

{commentauthor}
{commentauthor}
{commenttime}
{commentnum}
{commentcontent}
作者:
{commentrecontent}