# Custom class problem with buttonMode

**URL:** <https://forum.kirupa.com/t/custom-class-problem-with-buttonmode/255230>\
**Category:** flash\
**Created:** [March 20, 2008, 9:17am UTC](https://forum.kirupa.com/t/custom-class-problem-with-buttonmode/255230 "2008-03-20T09:17:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pawikan](https://avatars.discourse-cdn.com/v4/letter/p/c0e974/32.png) [@pawikan](https://forum.kirupa.com/u/pawikan)\
**Post date:** [March 20, 2008, 9:17am UTC](https://forum.kirupa.com/t/custom-class-problem-with-buttonmode/255230/1 "2008-03-20T09:17:09Z")

</div>

Hi fellow designers/ developers,

I created a class that displays text with added effects to it receiving string as its required parameter. It is extended to **Sprite** by default however when I made it clickable by adding MouseEvent and assigning its **buttonMode** to _true_, the **useHandCursor** won’t work even if I switch it to _true_ (I know its default is _true_ once buttonMode is true).

I tried tracing the problem through the MouseEvent handler by tracing the **event.target** and it traces an [object Textfield] instead of my custom class. Weird because I’m using my class in setting the buttonMode and useHandCursor properties. This custom class has a TextField inside it and when I tried removing that TextField in the class the **useHandCursor** works. I find this weird cause I already extended my class to **Sprite** so why in the world would it target the TextField inside it which is btw a private variable?

Any help or suggestions would be highly appreciated. Thanks!
