使用AS3和Tweenlite实现简单的3D 360旋转悬停效果
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用AS3和Tweenlite实现简单的3D 360旋转悬停效果相关的知识,希望对你有一定的参考价值。
demo: http://www.adamcoulombe.info/lab/as3/360-spin-hover.htmlFLA: http://www.adamcoulombe.info/lab/as3/360-spin-hover.fla
requires tweenlite
import com.greensock.*; import com.greensock.easing.*; //addEventListener(Event.ENTER_FRAME, rotateSquare); square.addEventListener(MouseEvent.MOUSE_OVER, over); /*function rotateSquare(e:Event):void { square.rotation+=1; }*/ function over(e:MouseEvent):void { var sourceObject = e.target; square.removeEventListener(MouseEvent.MOUSE_OVER, over); TweenLite.to(sourceObject, 0.5, { rotationY:720,rotationZ:10,rotationX:10, y:sourceObject.y-25, ease:Strong.easeOut, onComplete:function(){ square.addEventListener(MouseEvent.MOUSE_OUT, out); } }); } function out(e:MouseEvent):void { var sourceObject = e.target; square.removeEventListener(MouseEvent.MOUSE_OUT, out); TweenLite.to(sourceObject, 0.5, { rotationY:0,rotationZ:0,rotationX:0, y:sourceObject.y+25, ease:Strong.easeOut, onComplete:function(){ square.addEventListener(MouseEvent.MOUSE_OVER, over); } }); }
以上是关于使用AS3和Tweenlite实现简单的3D 360旋转悬停效果的主要内容,如果未能解决你的问题,请参考以下文章