带Flash/Actionscript 3的3D翻转效果
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了带Flash/Actionscript 3的3D翻转效果相关的知识,希望对你有一定的参考价值。
Demo, info & FLA download at http://adamcoulombe.info/lab/as3/card-flip.html
import com.greensock.TimelineLite; import com.greensock.TweenLite; import com.greensock.easing.*; card.z = 300; card.getChildAt(0).visible = false; card.getChildAt(0).rotationY = 180; card.addEventListener(MouseEvent.MOUSE_DOWN,cardDown); function cardDown(e){ flipSelf(e.currentTarget); } function flipSelf(self){ var toRot; if(self.rotationY > 89){ toRot = 0; }else{ toRot = 180; } var timeline = new TimelineLite(); timeline.insert(TweenLite.to(self,0.5,{z:200,ease:Back.easeOut })); timeline.insert(TweenLite.to(self,1.5,{rotationY:toRot,ease:Strong.easeInOut,onUpdate:setFlipSide, onUpdateParams:[self] })); timeline.insert(TweenLite.to(self,0.5,{z:300,ease:Back.easeIn }),0.75); } function setFlipSide(self){ if(self.rotationY > 89){ card.getChildAt(1).visible = false; card.getChildAt(0).visible = true; }else{ card.getChildAt(0).visible = false; card.getChildAt(1).visible = true; } }
以上是关于带Flash/Actionscript 3的3D翻转效果的主要内容,如果未能解决你的问题,请参考以下文章
带 Loader 的外部游戏在 Flash、Action Script 3 中不起作用
Flash ActionScript 3.0 按钮单击全局 MouseEvent.CLICK
Flash ActionScript 3.0 调整事件文本大小