Skip to main content
Inspiring
July 6, 2007
Question

Broadcasting Events with EventDispatcher

  • July 6, 2007
  • 3 replies
  • 360 views
Greetings all,

I am putting together a game where I have some clickable areas that dispatch events to some movieclips on my stage. When I add the movie clips onto the stage and add each clip to the broadcaster object with addEventListener it works great. However when I add the movieclips to the stage with a for loop the addEventListener doesn't seem to work. The event is being dispatched but the movieclips on stage don't seem to be getting them.

The for loop that is adding the clips is inside a function that is being called every three seconds by a setInterval call.
This topic has been closed for replies.

3 replies

kglad
Community Expert
Community Expert
July 6, 2007
great!
MaxManNHAuthor
Inspiring
July 6, 2007
Well I think I found the problem cause it is working now. Apparently the class that contains the code for the movieclips that are broadcasting did not like the way I was initializing the broadcaster object. I changed it to be inline with the attachMovie function and now they are all working fine.
kglad
Community Expert
Community Expert
July 6, 2007
is bn supposed to be dn (or vice-versa)?
MaxManNHAuthor
Inspiring
July 6, 2007
bn was supposed to be dn. I thought you got me on that one but I made the change and it still doesn't work for some reason. Its like the EventDispatcher has gone on walk about or something.