[as3] Event Propagation Issue on Stage
DisplayObjectContainer( root ).addChild( sprite1 );
DisplayObjectContainer( root ).addChild( sprite2 );
If I dispatch an event within sprite1, sprite2 doesn't receive it. Am I missing something obvious here? I've read all I can find on AS3 event propagation (including senocalars excelent posts) but cant find a solution.
I understand that events always start at the stage and propagate down to the originator and then back up, but I need it to go back down to the other sprite.
Making sprite2 a child of sprite1 obviously solves the problem by creates a tight coupling.
Ideas?
The problem here is that your event stops when it hits the surface (the end of the bubble). Thus you have to re propogate the event back down again (the capture phase) So make sure your events are set up to capture the right phases.
But ... I have never had to perform such trickery. Maybe if you rethought about your design, you might find you don't have to do it at all.
sprite1.addEventListener("click", sprite2.method);
sprite2 just won't recieve those events as its own.
#If you have any other info about this subject , Please add it free.# |

