 
 import flash.display.Bitmap;
 import flash.display.BitmapData;
+import flash.display.DisplayObject;
 import flash.display.Shape;
 import flash.display.SimpleButton;
 import flash.display.Sprite;

        stage.focus = this;
        addEventListener(FocusEvent.FOCUS_OUT, function (event :FocusEvent) :void {
            addClientWindow(int.MAX_VALUE - 1, "Click to restore input focus.");
        });
        addEventListener(FocusEvent.FOCUS_IN, function (event :FocusEvent) :void {
            removeWindow(int.MAX_VALUE - 1, false);

        if (!_socket.connected) {
            return;
        }
        var x :int = (event.stageX - _x) / _charWidth;
        var y :int = (event.stageY - _y) / _charHeight;
        if (x < 0 || y < 0 || x >= _width || y >= _height) {
            return;
        }
        var out :IDataOutput = startMessage();
        out.writeByte(event.type == MouseEvent.MOUSE_DOWN ?
            MOUSE_PRESSED_MSG : MOUSE_RELEASED_MSG);
        out.writeShort(x);
        out.writeShort(y);
        endMessage(out);
    }

