as3翻牌动画

 

 

----------------------------------------------------

主要利用了rotationY属性来进行处理,Pseudocode:

   1: import com.greensock.*;
   2: import com.greensock.easing.*;
   3:  
   4: //startValues for the card back
   5: flipper.back.rotationY = -90;
   6: flipper.back.alpha=0;
   7:  
   8: //speed of 90 degrees of flip
   9: var flipSpeed:Number = .5; 
  10:  
  11: //create TimelineMax instance
  12: var tl:TimelineMax = new TimelineMax({paused:true});
  13:  
  14: //flip the front 90 degrees
  15: tl.append(TweenMax.to(flipper.front, flipSpeed, {rotationY:90, visible:false, ease:Linear.easeNone}))
  16:  
  17: //set the back to alpha of 0 as soon as front finishes
  18: tl.append(TweenMax.to(flipper.back, 0, {alpha:1, immediateRender:false}))
  19:  
  20: //flip the back 90 degrees
  21: tl.append(TweenMax.to(flipper.back, flipSpeed, {rotationY:0, ease:Linear.easeNone}))
  22:  
  23: //basic button code
  24: flip1_mc.addEventListener(MouseEvent.CLICK, flip1);
  25:  
  26: function flip1(e:MouseEvent){
  27: // play to the beginning of the timeline
  28:     tl.tweenTo(0);
  29: }
  30:  
  31: flip2_mc.addEventListener(MouseEvent.CLICK, flip2);
  32: function flip2(e:MouseEvent){
  33: // play to the end of the timeline
  34:     tl.tweenTo(tl.duration);
  35: }

 

参考链接:Easy Breezy 3D Card Flip Effect with Flash, AS3 and Our Good Buddy TimelineMax

本示例下载链接:flipper_new_cs4.zip (需flash cs4+ 才能打开)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值