武斗火柴人格斗论坛

首页 » Stick Animation Class » 主题讨论 Topic DIscuss » 使用外部类设置缓动
ppzhu - 2008-3-29 13:59:00
基础缓冲见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


如果上面代码有什么问题请指出~~有空会修改
ppzhu - 2008-3-29 14:05:00
至于怎么用,大家就各自发挥吧~~
:Yoci9:
solo - 2008-3-29 17:24:00
这我倒没用过  不过值得一试~  看能不能加到镜头控件去, 让镜头的移动更自然
notshy - 2008-5-20 16:31:00
给一个范例。我看不明白 大哥
1
查看完整版本: 使用外部类设置缓动