var tf:TextField = new TextField();
tf.multiline = true;
tf.type = TextFieldType.INPUT;
tf.addEventListener(MouseEvent.MOUSE_DOWN, this.mouseDownHandler);
tf.addEventListener(MouseEvent.MOUSE_UP, this.mouseUpHandler);
var begin:int;
var end:int;

function mouseDownHandler(event:Event):void
{
tf.setSelection(this.begin, this.end);
}

function mouseUpHandler(event:Event):void
{
this.begin = tf.selectionBeginIndex || tf.selectionEndIndex;
this.end = tf.selectionEndIndex;
}

this.addChild(tf);

Not perfect, but close.

Reply via email to