使用外部类设置缓动
基础缓冲见SOLO帖子
http://www.wu-dou.com/showtopic-548.aspx下面是我学到的使用外部类设置缓动(缓冲)founction ball(){
// 定义缓动类型 var easeType=mx.transtitions.easing.Elastic.easeOut;
//初始位置和结束位置
var begin=20:
var end=400;
//活动周期,根据实际情况,自己调值
var time=0.5;
//定义MC名
var mc=ball_mc;
//tween的构造函数,说白了就是一个公式,大家可以拿来套用
// "_x"沿X轴缓动,可以替换_y , _alpha等
ballTween=nwe mx.transtition.Tween(mc,"_x",easeType,begin,end,time,true);
}
//用按钮实现调用上面用定义的函数bt.onRelease=function(){
ball();
}
easeType类型其实有很多种,大家自己试试mx.transtitions.easing.
Elastic.easeOut
Bounce
Strong
Back
mx.transtitions.easing.
Elastic.easeInOut
Bounce
Strong
Back
如果上面代码有什么问题请指出~~有空会修改