我發生了點擊(移動字符)時,鼠標位置上的事件監聽器(座標)發生此遊戲。actionscript 3,removeEventListener無法正常工作
我有另一個事件監聽器拖放(合併項目),工作得很好。
function stageDown (event:MouseEvent):void
{
stage.removeEventListener(MouseEvent.CLICK, coordinates);
MovieClip(getChildByName(event.target.name).toString()).startDrag();
MovieClip(getChildByName(event.target.name).toString()).addEventListener(MouseEvent.MOUSE_UP,stageUp);
...stuff..
}
function stageUp(event:MouseEvent):void
{
stopDrag();
...stuff...
stage.addEventListener(MouseEvent.CLICK, coordinates);
}
在功能stageDown我刪除了事件偵聽運動(座標),比我再次添加它在功能stageUp結束(當你鬆開鼠標按鈕,拖動完成)
但不工作,當我鬆開拖字開始移動,無法理解爲什麼
是附着在舞臺你的'stageDown'處理程序(如名稱可能暗示)?或您正在拖動的項目? – BadFeelingAboutThis
'MovieClip(getChildByName(event.target.name).toString())。startDrag();'哦親愛的! – null
哦,親愛的,猜猜簡單的「event.target.startDrag()」並不夠時髦...... – BotMaster