当前位置:首页 > 设计在线 > 平面动画 > Flash > 一个flash彩色光条的效果

一个flash彩色光条的效果

点击次数:28 次 发布日期:2008-11-21 23:30:20 作者:源代码网
源代码网推荐 做了一个彩色光条的效果,效果请浏览
http://www.flashplayer.cn/example/colorlight/
 
制作非常简单,基本就是应用一下mask效果,复制多个光条利用一些随机性产生效果
for (var i:Number = 0; i<15; i++) {
 var tmpmc:MovieClip = light.duplicateMovieClip("light_"+i, i+1);
 tmpmc._x = randomZone(150, 500);
 tmpmc._y = randomZone(150, 400);
 tmpmc._xscale = randomZone(70, 120);
 tmpmc._yscale = randomZone(70, 120);
 tmpmc._rotation = randomZone(0, 360);
 tmpmc.b.gotoAndPlay(randomZone(1, 130));
 tmpmc.b.a.gotoAndPlay(randomZone(1, 50));
}
//返回s到e的随机数,包括s和e
function randomZone(s:Number, e:Number):Number {
 return s+Math.floor((e-s+1)*Math.random());
}
下载源文件:http://www.flashplayer.cn/example/colorlight/colorlight.fla
文章来自: 闪无忧(www.5uflash.com) 详文参考:http://www.5uflash.com/html/flashjiaocheng/Flashdonghuatexiao/20080324/45.html
源代码网供稿.
网友评论 (0)
会员中心
设计在线
本站推荐
设计在线之精华