Skip to main content
Known Participant
January 17, 2008
Question

Catching an event fired in another class

  • January 17, 2008
  • 2 replies
  • 409 views
Hey Everyone,
I have one main class and two subclasses. The main class instantiates the two subclasses. One of the subclasses is a circle class that loads in images and masks them, and the other is a list class that lists out a bunch of buttons. I have over 200+ buttons being generated from an xml file in the list class. What I want to have happen is this:

On rollover of one of the list buttons, load the corresponding image into the circle class.

How do I add an event listener that fires upward into the main class so I can load the image into the circle class?

Attached is my current code.

Thanks, TK
This topic has been closed for replies.

2 replies

Inspiring
January 20, 2008
or:

new BLNavStation_List(this);
kglad
Community Expert
Community Expert
January 17, 2008
your main class has a reference to a list class member. you can add a listener to that list class member that calls a method in your main class (or a circle class method if you have a reference to a circle class member) that listens for a custom event dispatched by your list class member.