Reputation: 43
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?
Upvotes: 1
Views: 434
Reputation: 4530
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();
}
Upvotes: 3