AS3轻松鼠标平移
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了AS3轻松鼠标平移相关的知识,希望对你有一定的参考价值。
A simple demo that shows how to pan from one side of an object to another dynamically in actionscript 3.demo at: http://www.adamcoulombe.info/lab/as3/sliderbox.html
//A simple demo that shows how to pan from one side of an object to another dynamically in actionscript 3. //demo at: http://www.adamcoulombe.info/lab/as3/sliderbox.html import fl.transitions.Tween; import fl.motion.easing.*; import fl.transitions.TweenEvent; var sliderBoxTween:Tween stage.addEventListener(MouseEvent.MOUSE_MOVE,mouseMoved) function mouseMoved(e){ var xPercent = mouseX / stage.stageWidth; var newXPos = (stage.stageWidth - sliderBox.width) * xPercent; sliderBoxTween = new Tween(sliderBox, "x", Circular.easeOut, sliderBox.x, newXPos, 1, true); }
以上是关于AS3轻松鼠标平移的主要内容,如果未能解决你的问题,请参考以下文章