How to prevent ctrl+v paste for flash.display.textarea()?
field.selectable = false; does not seem to work, also it disables caret/cursor
How to prevent ctrl+v paste for flash.display.textarea()?
field.selectable = false; does not seem to work, also it disables caret/cursor
this seem to work in TextEvent listener, any comments is it too bad solution to avoid copy+paste to a field ?
if (evt.text.length >1)
evt.preventDefault () ;
A TextArea is an editable textfield. You should use another component if you want to prevent copy / paste.
If you can, use a different component instead of TextArea, as monkee suggested.
If you're really into protecting against copying your text data you might even want to consider drawing the text on a canvas directly so it's really impossible to grab it unless the user does OCR or something.
The TextArea component has a textField property. Setting the mouseEnabled property of the textField should have the desired effect.
var ta:TextArea = new TextArea();
ta.textField.mouseEnabled = false;
This disables the caret cursor and prevents selection of the text.