您当前的位置:酷new网网页制作Flash → 在线教程内容

一个flash彩色光条的效果

  • 作者:佚名    来源:不详    发布时间:2008-5-17 18:58:56
  • 字体大小:

一个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