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
本文地址:http://www.cg3000.com/html/cgTutorials/Website/Flash/20070706/yigecaiseguangtiaodexiaoguo_11898.shtml


当前位置 :