How many event listeners in stage?
With stage.numChildren I know how many objects I added to the stage, but I want to know how many addEventListener I set up.
In doing so I can monitor the memory usage. I th开发者_如何学运维ink the project I'm working on I can't have event listener for each one object. I think I'm going to have to take advantage of arrays and loops.
Taking it into account I am also learning.
Thanks in advance.
You have to keep count of how many listeners you add. "hasEventListener" is your friend in this case if you have a small select number of event types.
精彩评论