AS 3.0 弹性效果

AS 3.0 弹性效果 - JQD - The future is in my
 package{
 import fl.transitions.*;
 import fl.transitions.easing.*;
 import flash.display.Sprite;
 
 public class backt extends Sprite{
  
  public function backt(){
   var ball1 = Ball();
   var ball2 = Ball();
   var ball3 = Ball();
   var ball4 = Ball();
   var ball5 = Ball();
   ball1.x = 50;
   ball1.y = 50;
   addChild(ball1);
   
   ball2.x = 50;
   ball2.y = 150;
   addChild(ball2);
   
   ball3.x = 50;
   ball3.y = 250;
   addChild(ball3);
   
   ball4.x = 50;
   ball4.y = 350;
   addChild(ball4);
   
   ball5.x = 50;
   ball5.y = 450;
   addChild(ball5);
   //正弦弹性
   var myTween1:Tween = new Tween(ball1,"x",Elastic.easeIn,ball1.x,400,3,true);
   //折射效果
      var myTween2:Tween = new Tween(ball2,"x",Back.easeIn,ball2.x,400,3,true);
   //运动回弹
   var myTween3:Tween = new Tween(ball3,"x",Bounce.easeIn,ball3.x,400,3,true);   
   var myTween4:Tween = new Tween(ball4,"x",Regular.easeIn,ball4.x,400,3,true);
   var myTween5:Tween = new Tween(ball5,"x",Strong.easeIn,ball5.x,400,3,true);
   
   myTween1.looping = true;
   myTween2.looping = true;
   myTween3.looping = true;
   myTween4.looping = true;
   myTween5.looping = true;
   }
  
  public function Ball():Sprite{
   var sp:Sprite = new Sprite();
   sp.graphics.beginFill(Math.random()*0xFFFFFF);
   sp.graphics.drawCircle(0,0,30);
   sp.graphics.endFill();
   return sp;
   }
   }
 
 }
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值