Multiple MCs, Single Listener, AsBroadcaster
Posted
by Brett
on Stack Overflow
See other posts from Stack Overflow
or by Brett
Published on 2009-05-18T13:51:34Z
Indexed on
2010/03/23
23:03 UTC
Read the original article
Hit count: 441
actionscript-2
|flash
I'm currently working trying to have multiple MCs inside a container MC which when they mini MCs are clicked will broadcast a message so that I can act upon them. This would be simple in AS 3 as it would be mc.addEventListener(MouseEvent.CLICK, obj); however, this is AS 2 and so I am semi-forced to use the broadcastMessage('myMessage'); and mc.addListener(obj); event handler.
The main problem is that the broadcaster isn't broadcasting any messages.
The second problem is that there are 5 MCs and when I click one of them, I get 5 trace messages about the click. I can't seem to keep the MC clicks unique even though they are all given separate instance names vie the properties panel.
Any help would be appreciated.
A link to my code is here (pastie.org #481511). Can you see anything wrong?
© Stack Overflow or respective owner