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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章