# Inheritance with Buttons?

**URL:** <https://forum.kirupa.com/t/inheritance-with-buttons/288075>\
**Category:** flash\
**Created:** [May 10, 2009, 10:17pm UTC](https://forum.kirupa.com/t/inheritance-with-buttons/288075 "2009-05-10T22:17:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![grandpaw\_broon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/grandpaw_broon/32/3985_2.png) [@grandpaw\_broon](https://forum.kirupa.com/u/grandpaw_broon)\
**Post date:** [May 10, 2009, 10:17pm UTC](https://forum.kirupa.com/t/inheritance-with-buttons/288075/1 "2009-05-10T22:17:24Z")

</div>

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:

```auto
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

```auto
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 😃
