AS3 – Uppercase an input textfield’s contents automatically

Here is a quick snippet on how to automatically set an input textfield’s text to uppercase. (If you do it on the KeyboardEvent.KEY_UP event, the text will initially show as lowercase than change to uppercase.)

1
2
3
4
5
text_txt.addEventListener(Event.CHANGE, toUpperCase)
 
private function toUpperCase(evt:Event):void {
	evt.target.text = evt.target.text.toUpperCase();
}
  1. No comments yet.

  1. No trackbacks yet.

 

Switch to our mobile site