闪光AS3的EventDispatcher - 任何方式获得注册的听众的名单呢? [英] Flash AS3 EventDispatcher - any way of getting a list of registered listeners?

查看:187
本文介绍了闪光AS3的EventDispatcher - 任何方式获得注册的听众的名单呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法获得注册的侦听器的一个列表的的EventDispatcher

Is there any way of getting a list of registered listeners for an EventDispatcher?

我知道的EventDispatcher 器,hasEventListener 的方法来告诉你,如果任何监听器被注册,但有一个询问的简便方法的EventDispatcher 来找出听众是谁?

I know that EventDispatcher has the hasEventListener method to tell you if any listeners are registered, but is there an easy way of interrogating the EventDispatcher to find out what the listeners are?

我想这样做的一种方法是子类的EventDispatcher 覆盖的addEventListener 方法和存储听众一本字典,但这种感觉笨重的我。

One way I figured to do this was to subclass EventDispatcher to override the addEventListener method and store the listeners in a dictionary, but this feels clunky to me.

任何想法?

推荐答案

好了,似乎没有回答这个问题,比我原来存储的听众在一个字典,并明确地消除他们的想法等。哦...

Ok, so it seems that there is no answer to this question other than my original idea of storing listeners in a Dictionary and removing them explicitly. Oh well...

有关复杂一些有趣的想法AS3事件系统可以在这里找到

这篇关于闪光AS3的EventDispatcher - 任何方式获得注册的听众的名单呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆