The final two methods of the IEventDispatcher interface provide useful information about the existence of event listeners. The hasEventListener() method returns true if an event listener is found for a specific event type on a particular display list object. The willTrigger() method also returns true if a listener is found for a particular display list object, but willTrigger() checks for listeners not only on that display object, but also on all of that display list object's ancestors for all phases of the event flow.
HasEventListener and WillTrigger
事件监听检查方法
最新推荐文章于 2024-09-18 22:46:48 发布
本文介绍IEventDispatcher接口中的两种方法:hasEventListener()和willTrigger()。前者用于检查特定显示列表对象上是否存在特定类型的事件监听器;后者不仅检查该显示对象,还检查其所有祖先对象在事件流的所有阶段是否存在监听器。
1万+

被折叠的 条评论
为什么被折叠?



