How to remove all event listeners from a display object?

后端 未结 5 900
天涯浪人
天涯浪人 2021-02-08 15:21

Is there a way to determine which event listeners are registered with a display object? I want to remove all event listeners from a display object so that I can assign new ones

5条回答
  •  粉色の甜心
    2021-02-08 15:47

    function a(){
        mc.addEventListener(Event.ENTER_FRAME,function(){
                           ...
                           }
    }
    
    function b(){
        mc.removeEventListener(Event.ENTER_FRAME,function(){});
    }
    

    works...

提交回复
热议问题