一个flash彩色光条的效果
2008-5-17 13:12:00查看学习心得 做了一个彩色光条的效果,效果请浏览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
上一篇:导致你的网站被K的七个做法
下一篇:新闻联播、福建广电就火炬手空手捐款致歉


