小试rotation
来源:互联网 发布:淘宝第三方公司 编辑:程序博客网 时间:2024/06/15 00:11
AS3.0 中指示 DisplayObject 实例距其原始方向的旋转程度,一般用rotation来做这样的旋转效果,下面是我小试一下rotation中的rotationY即以Y轴为中心旋转的实例:
//是否反转
var isDown:Boolean = false;
//一直旋转
addEventListener(Event.ENTER_FRAME,enterFrame);
//侦听鼠标移到金币上,停止金币的旋转
addEventListener(MouseEvent.MOUSE_OVER,mouseOverEvt);
//侦听鼠标移出金币,回复金币的旋转
addEventListener(MouseEvent.MOUSE_OUT,mouseOutEvt);
//侦听鼠标点击金币,使金币反向绕Y轴旋转
addEventListener(MouseEvent.MOUSE_DOWN,mouseDownEvt);
function enterFrame(event:Event):void
{
gold.gotoAndStop(1);
//gold为元件名
if(isDown)
gold.rotationY -= 10;
else
gold.rotationY += 10;
}
function mouseOverEvt(event:MouseEvent):void
{
gold.gotoAndStop(2);//描边金币效果
removeEventListener(Event.ENTER_FRAME,enterFrame);
gold.rotationY = 0;
}
function mouseOutEvt(event:MouseEvent):void
{
gold.gotoAndStop(1);
addEventListener(Event.ENTER_FRAME,enterFrame);
}
function mouseDownEvt(event:MouseEvent):void
{
isDown = !isDown;
}
简单粗略的写写尔耳,呵呵!
- 小试rotation
- Rotation transformation
- 2.rotation
- string rotation
- IOS6 rotation
- transform.rotation
- iOS rotation
- Rotation Matrix
- array rotation
- android rotation
- iOS Rotation
- rotation*vector3
- imutils Rotation
- Rotation representation
- Rotation effect
- WinCE LCD Rotation
- image rotation and zoom
- AVL Tree Rotation
- Nokia手机联系人的转存
- .NET4.0并行计算技术基础——来自bitfan(数字世界一凡人)
- Windows Socket五种I/O模型——select模型
- bcb中浮点数的四舍五入的问题
- linux 下 java 执行 shell 命令
- 小试rotation
- 多线程之线程同步中的信号量AutoResetEvent和ManualResetEvent
- 一键分享到 Qzone
- C++类的对象和类的指针的区别
- c++给力总结一(代码实例)
- RockAudioPlayer
- 大小端模式测试程序
- zendframeword实例,不错的博客地址!!
- 获取Android手机上的图片和视频缩略图