# Capturing mouse click, sprite

**URL:** <https://forum.kirupa.com/t/capturing-mouse-click-sprite/320526>\
**Category:** flash\
**Created:** [March 26, 2011, 2:38am UTC](https://forum.kirupa.com/t/capturing-mouse-click-sprite/320526 "2011-03-26T02:38:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![seanad](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@seanad](https://forum.kirupa.com/u/seanad)\
**Post date:** [March 26, 2011, 2:38am UTC](https://forum.kirupa.com/t/capturing-mouse-click-sprite/320526/1 "2011-03-26T02:38:45Z")

</div>

1. I create a board class in board.as as so,  
public class board extends Sprite  
{  
public function board(p1:Number = 0, p2:Number = 0, p3:Boolean = true)  
{  
this.mouseEnabled = true;

addEventListener(MouseEvent.CLICK, go);

}

private function go(e:MouseEvent)  
{  
trace(“mouse clicked”);  
}

## } 2. in .fla, I declare the document as an instance of the board class. 3. clicking anywhere on the document’s UI, no tracing output. 4. if I put a textfield as the child of board object (by adding these lines, var tf:textField = new textfield();

addChild(tf);  
in the constructor), i do see above trace() working.

what am I missing? How can my board class receive mouse click?

TIA  
-s
