当前位置:软件学习 > Flash >>

Flash制作随意飘飞的彩色肥皂泡

本文中我们用Flash制作随意飘飞的彩色肥皂泡动画。

  完成效果如下:

http://www.zzzyk.com/imagelist/2007/119/7j19oiv8t456.swf




制作步骤如下:

点击放大此图片

点击放大此图片

点击放大此图片

   //写在帧的代码

i = 0;
ppo._visible=false
function enet() {
        i++;
        sc = random(50)+20;
        duplicateMovieClip("ppo", "ppo"+i, i);
        _root["ppo"+i]._x = random(550);
        _root["ppo"+i]._y = random(400);
        _root["ppo"+i]._xscale = _root["ppo"+i]._yscale=sc;
}
onEnterFrame = function () {
        if (i<25) {
                enet();
        }
};
 


点击放大此图片


//写在元件本身的代码
onClipEvent (load) {
        xx = random(550);
        xy = random(400);
        dt = 50;
        this.ys._alpha=random(150)+50;
        var yanse:Color = new Color(this.yanse_mc);
        yanse.setRGB(random(0xffffff));
}
onClipEvent (enterFrame) {
        if (random(dt) == 1) {
                xx = random(550);
                xy = random(400);
        }
        //  
        dx = (xx-_x);
        dy = (xy-_y);
        dx*=.01;
        dy*=.01;
        //dx*=.4;
        //dy*=.4
        _x += dx;
        _y += dy;
        _rotation+=0;
}

 

CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,