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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值