views:

63

answers:

2

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?

A: 

I've got it half answered. I was missing a "this" before the broadcastMessage() call so once I changed it to this.broadcastMessage('myMessage', this) it started working.

Still have the issue with 5 different instances (i.e. dragged-&-dropped 5 times from the library and named them different instance names) of one movie clip all calling the same broadcast message at the same time. I get the following output:

Object: _level0.instance1.photo5
Object: _level0.instance1.photo4
Object: _level0.instance1.photo3
Object: _level0.instance1.photo2
Object: _level0.instance1.photo1
Brett
A: 

Figured it out. Ended up having to use the hitTest() method to see if the click was within a specific movieclip or not.

Brett