TextField () - how to prevent mouse selection

How can I prevent mouse selection (and carriage movement) using Editable TextField (), this one doesn't seem to work completely when selecting text, but it prevents a click. I want to keep the cursor where it goes.

protected function handleMouseDEvent(evt:MouseEvent):void {
if (evt.type == MouseEvent.MOUSE_DOWN) {
var max : int;
max = this.text.length;
this.setSelection(max, max) // SET CURSOR POSITION  
}
}
+3
source share
4 answers

What about selectable = "false"?

+1
source

if you want to prevent the selection of TextField, use:

TextField.selectable = false;

But if you want to prevent the TextField object from being locked, use:

TextField.mouseEnabled = false;
+3
source

?

0

, , , , handCursor

,

0
source

Source: https://habr.com/ru/post/1703670/


All Articles