1  /  1  Page   1 GotoPage View:1289

[讨论] 使用外部类设置缓动

使用外部类设置缓动

基础缓冲见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


如果上面代码有什么问题请指出~~有空会修改
 

回复:使用外部类设置缓动

至于怎么用,大家就各自发挥吧~~
 

回复:使用外部类设置缓动

这我倒没用过  不过值得一试~  看能不能加到镜头控件去, 让镜头的移动更自然
 

回复:使用外部类设置缓动

给一个范例。我看不明白 大哥
 
1  /  1  Page   1 GoPage

版权所有 武斗火柴人格斗论坛  Discuz!NT  Sitemap

Powered by Discuz!NT 2.1.202    Copyright © 2001-2008 Comsenz Inc.
Processed in 0.046875 second(s) , 3 queries.
返顶部