仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2355|回复: 9
打印 上一主题 下一主题

[学习教程] FLASH教程之Flash AS2实例:跳动的小球动画效果-Flash actionscript

[复制链接]
再现理想 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-1-15 20:42:35 | 显示全部楼层 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
AdobeFlashProfessionalCS5.5软件可以提供行业领先、用于制作具有表现力的交互式内容的授权环境。
Poluoluo中心提醒:FlashAS2实例:跳动的小球动画效果.
效果显现:
[media=wmv,550,400][/media]

具体代码:
//AS2.0QQ:315597832009.11.28
MovieClip.prototype.zl=function(){
this.vg=0.7;
this.vy=0;
this.vx=0;
this.an=true;
this.onEnterFrame=function(){
this.vy+=this.vg;
this._y+=this.vy;
this._x+=this.vx;
if(this._x>550){
this._x=0;
}
if(this._x<0){
this._x=550;
}
if(this._y>300){
this._y=300;
this.vy*=-0.5;
this.vx*=0.9;
}
if(this._y==300&&this.an==true){
ss(this._x,this._y);
}
if(this._y==300&&Math.abs(this.vy)>>0==0){
this.an=false;
}
};
this.tt=function(){
this.vg=0.7;
this.vy=0;
this.vx-=(this._x-_root._xmouse)/30;
this.dy=this._y-_root._ymouse;
this.vy-=this.dy/10;
};
};
functionss(X,Y){
varsj=(Math.random()*10+20)>>0;
for(vari=0;i<sj;i++){
varmc=this.createEmptyMovieClip("huaxian_mc",this.getNextHighestDepth());
mc._x=X;
mc._y=Y;
mc.lineStyle(Math.random()*3,0,100);
mc.moveTo(0,0);
mc.lineTo(1,0);
mc.vx=random(20)-10;
mc.vy=random(20)-10;
mc.onEnterFrame=function(){
this._x+=this.vx;
this._y+=this.vy;
this.vy+=0.8;
this._alpha-=2;
if(this._alpha<1||this._y>=300){
this.removeMovieClip();
}
};
}
}
mc.zl();
mc1.zl();
this.onMouseDown=function(){
if(mc.an==false){
ss(mc._x,mc._y);
mc.an=true;
mc.tt();
}
};
this.onEnterFrame=function(){
if(random(50)==0){
if(mc1.an==false){
ss(mc1._x,mc1._y);
mc1.an=true;
mc1.tt();
}
}
};

源文件下载:腾跃的小球.rar
AdobeFlashCS5.5中的动画制作更简单,借助基于对象的动画快速创建动画、轻松修改运动路径并全面控制个别动画属性。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-6-9 20:54

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表