• 【设为首页】
  • 【收藏闪客居】
当前位置:主页>AS 应用>文章内容
  • Flash打造随意飘飞的彩色肥皂泡(as2.0)
  • 来源: 作者: 2008-04-12 【

本文中我们用Flash制作随意飘飞的彩色肥皂泡动画。完成效果如下:


 


制作步骤如下:

/upimg/allimg/080413/2359390.jpg


/upimg/allimg/080413/2359391.jpg


/upimg/allimg/080413/2359392.jpg


//写在帧的代码:
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();
}
};

/upimg/allimg/080413/2359393.jpg


//写在元件本身的代码:
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;
}

/upimg/allimg/080413/2359394.jpg



上一篇:简单倒计时类的应用(as2.0)   下一篇:BitmapData抠图小实验(as3.0)
  • 用户名:新注册) 密码: 匿名评论
  • 评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规)

Copyright © 2006-2008 flashas.net All Rights Reserved.
网站内容咨询: admin#flashas.net (#为@) 联系QQ:40777822 浙ICP备06033001号
(本网站最佳浏览解析度为1024*768, 建议使用IE 6.0或以上版本浏览器。)