----------------------------------------------------
主要利用了rotationY属性来进行处理,Pseudocode:
1: import com.greensock.*;
2: import com.greensock.easing.*;
3:
//startValues for the card back
5: flipper.back.rotationY = -90;
6: flipper.back.alpha=0;
7:
//speed of 90 degrees of flip
var flipSpeed:Number = .5;
10:
//create TimelineMax instance
true});
13:
//flip the front 90 degrees
false, ease:Linear.easeNone}))
16:
//set the back to alpha of 0 as soon as front finishes
false}))
19:
//flip the back 90 degrees
21: tl.append(TweenMax.to(flipper.back, flipSpeed, {rotationY:0, ease:Linear.easeNone}))
22:
//basic button code
24: flip1_mc.addEventListener(MouseEvent.CLICK, flip1);
25:
function flip1(e:MouseEvent){
// play to the beginning of the timeline
28: tl.tweenTo(0);
29: }
30:
31: flip2_mc.addEventListener(MouseEvent.CLICK, flip2);
function flip2(e:MouseEvent){
// play to the end of the timeline
34: tl.tweenTo(tl.duration);
35: }