Inheritance with Buttons?

Hi all,

I have a simple button which behaves exactly as the others. The only difference is Embedded vector artwork.

Default button is simply a circle with mouse event listeners attached.

DefaultButton:

this.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);

protected function onMouseOver(e:MouseEvent): void
{
     trace("Fool");
} 

If i was to create a DefaultButton instance, i would see trace output when i mouse over.

However,

Lets say i now have HomeButton extends DefaultButton which simply adds an artwork layer to the existing button.

The event listeners no longer fire.

If i cut the

this.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);

code and place it in the new HomeButton init() method. Then it works.

I suppose the question is, why does subclass events seem to get cancelled?

I thought it had to do with the artwork covering the roll_over area but even if i set the MouseEnabled property to false, i get the same issue.

Cheers :smiley: