Flash AS生成飘动的云和风吹动的草

 Flash 的AS是非常神奇的,今天通过本例大家就体会出来了!可以直接用代码生成云飘动,草被风吹的左右摇摆的动画。至于动画效果,[1b]因为AS总是运算,所以你的机器是会越来越慢的![/1b]我这里就不提供在线效果了!给大家截个图。提供源文件给大家下载。
[img]/Files/BeyondPic/2007-10/24/20071024113410648.jpg[/img]
[img]/Files/BeyondPic/2007-10/24/rar.gif[/img]
 
[url=http://www2.flash8.net/UploadTeach/200710/20071024113656563.rar]as动画.rar[/url]
(压缩包里包括Fla和SWF)
简单描述下制作方法。
首先建立两个空的影片剪辑cloud和grass。先建立云的影片剪辑(里面什么都不画)
[img]/Files/BeyondPic/2007-10/24/20071024113410315.jpg[/img]
选择该元件的第一帧,添加如下代码:
//Number of clouds
clouds=6;
//These are just general boundaries. 
//To use exact boundaries, create a mask in the parent level of the size desired
//Height of the sky
skyheight=Stage.height;
//Width of the sky
skywidth=Stage.width;
//Max size of a cloud
cloudsize=300;
//Amount of blur applied to the shapes to make them cloud-like
blursize=40;
//Clouds move at a random speed. this is the minimum speed
cloudminspeed=.5;
//Variance in speed from cloud to cloud
cloudspeedvariance=1;
//Create the clouds
for(c=1;c
本文转自:http://www.5uflash.com/flashjiaocheng/Flashaschengxu/544.html
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章