addEventListener not detecting children (even with bubbles)
there's probably a very simple solution but I'm at my wit's end here.
I have a sprite called content
In this sprite there are multiple children that I add and remove (lot's of traffic there)
these children dispatch events that bubble.
I have an event listener listening to content and checking for the same type of event.
The order goes
content = new Sprite();
content.addEventListener(AttentionEvent.开发者_如何学编程NEED_FOCUS,focusEventTarget);
content.addChild(new someChildThatDispatches());
this DOESNT work, however.
content = new Sprite();
content.addChild(new someChildThatDispatches());
content.addEventListener(AttentionEvent.NEED_FOCUS,focusEventTarget);
that works..
But the problem with the second model is that I would have to track every time something is changed in the children tree and add the event listener which kinda defeats the entire purpose of bubbling for me.
Does anyone know what I'm doing wrong?
Thank's in advance
strange, it should work with the first model… do you mind posting your custom event manager?
精彩评论