标签:cli dde rem event remove function col listener clip
import flash.events.MouseEvent; import flash.display.MovieClip; var arr:Array=[] mc.addEventListener(MouseEvent.MOUSE_DOWN,onDown) function onDown(e:MouseEvent){ stage.addEventListener(MouseEvent.MOUSE_UP,onUp) stage.addEventListener(MouseEvent.MOUSE_MOVE,onMove) } function onMove(e:MouseEvent){ mc.rotation=180/Math.PI*Math.atan2(mouseY-mc.y,mouseX-mc.x)+90 arr.push(mc.rotation) var num:Number=arr[arr.length-1]-arr[arr.length-2] if(num>0){ trace("正转") }else{ trace("倒转") } if(arr.length>3){ arr.shift() } } function onUp(e:MouseEvent){ stage.removeEventListener(MouseEvent.MOUSE_MOVE,onMove) stage.removeEventListener(MouseEvent.MOUSE_UP,onUp) }
、、
标签:cli dde rem event remove function col listener clip
原文地址:https://www.cnblogs.com/zqiang0803/p/12028458.html