Created
November 9, 2010 04:39
-
-
Save geraldyeo/668709 to your computer and use it in GitHub Desktop.
Enter key prevention in multiline textfield
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
textfield.addEventListener(KeyboardEvent.KEY_UP, keyHandler); | |
private function keyHandler(event:KeyboardEvent):void { | |
if(event.type == KeyboardEvent.KEY_UP && event.keyCode == Keyboard.ENTER) { | |
event.target.text = event.target.text.replace("\r", ""); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment