How to remove all event listeners from a display object?

后端 未结 5 922
天涯浪人
天涯浪人 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

    Glenn is right, there is no such thing as a removeAllListener or listAllListener method. Nevertheless, you could make your custum diplayObject implement the IEventDispatcher interface and keep track of all the listeners added or removed from your object.

提交回复
热议问题