gz 为一个影片

import flash.display.Sprite;
stage.addEventListener(MouseEvent.MOUSE_MOVE, onStageMouseMoveHandle);
function onStageMouseMoveHandle(evt:MouseEvent):void
{
	if (gz.parent as Sprite)
	{
		var parentObj:Object=gz.parent;
		
		gz.rotation = 180 / Math.PI * Math.atan2(parentObj.mouseY - gz.y,parentObj.mouseX - gz.x);
	}
}

 源文件:https://files.cnblogs.com/files/dt1991/as3_%E6%A0%B9%E6%8D%AE%E9%BC%A0%E6%A0%87%E7%A7%BB%E5%8A%A8%E6%96%B9%E5%90%91.zip

posted on 2017-10-29 13:22  我是cdt  阅读(154)  评论(0编辑  收藏  举报