         if (!_socket.connected) {
             return;
         }
-        var idx :int = _field.getCharIndexAtPoint(
-            event.stageX - _field.x, event.stageY - _field.y);
-        if (idx == -1) {
+        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(idx % (_width + 1));
-        out.writeShort(idx / (_width + 1));
+        out.writeShort(x);
+        out.writeShort(y);
         endMessage(out);
     }
 

                }
                _contents[idx] = nvalue;

                var tidx :int = yy*(_width + 1) + xx;
                var ochar :int = ovalue & 0xFFFF;
                var nchar :int = nvalue & 0xFFFF;
                var nrev :int = (nvalue & REVERSE_FLAG);
                var ndim :int = (nvalue & DIM_FLAG);
                if (ochar != nchar) {
                    _field.replaceText(tidx, tidx + 1, String.fromCharCode(nchar));
                    _field.setTextFormat(nrev == REVERSE_FLAG ? _reverseFormat :
                        (ndim == DIM_FLAG ? _dimFormat : _normalFormat), tidx, tidx + 1);
                }
                if ((ovalue & REVERSE_FLAG) != nrev) {
                    if (nrev == REVERSE_FLAG) {
                        // the char boundaries might not be valid yet, so we compute the location
                        // assuming the text is centered within the field
                        var highlight :Bitmap = new Bitmap(_highlightData);
                        addChildAt(_highlights[idx] = highlight, 0);
                        var cbounds :Rectangle = _field.getCharBoundaries(0);
                        highlight.x = _field.x + cbounds.width*xx +
                            (_field.width - cbounds.width*_width)/2;
                        highlight.y = _field.y + cbounds.height*yy +
                            (_field.height - cbounds.height*_height)/2;
                        if (ochar == nchar) {
                            _field.setTextFormat(_reverseFormat, tidx, tidx + 1);
                        }
                    } else {
                        removeChild(_highlights[idx]);
                        _highlights[idx] = null;
                        if (ochar == nchar) {
                            _field.setTextFormat(ndim == DIM_FLAG ? _dimFormat : _normalFormat,
                                tidx, tidx + 1);
                        }
                    }
                }
                if ((ovalue & DIM_FLAG) != ndim && nrev != REVERSE_FLAG && ochar == nchar) {
                    _field.setTextFormat(ndim == DIM_FLAG ? _dimFormat : _normalFormat,
                        tidx, tidx + 1);
                }
            }
        }
    }

    /**

import flash.filters.BevelFilter;
import flash.filters.BitmapFilterType;

import flash.geom.Matrix;
import flash.geom.Point;
import flash.geom.Rectangle;

