- 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