1

I disabled the Paste option in right click of TextArea using:

MyField.textField.mouseEnabled = false;

But still i can paste any text using CTRL+V is there anyway to stop it?

1 Answers1

3

You could listen for TEXT_INPUT event, and prevent default if text.length is greater then 1.

MyField.textField.addEventListener( TextEvent.TEXT_INPUT, onTextInput );

function onTextInput( e:TextEvent ):void 
{
    if( e.text.length > 1 ) 
       e.preventDefault();
}
sanchez
  • 4,519
  • 3
  • 23
  • 53