Limit lines in a textfield

/ Published in: ActionScript 3
Save to your folder(s)

Copy this code and paste it in your HTML
  1. var prevText:String;
  2. inputfield.addEventListener(Event.CHANGE, onUpdate);
  4. private function onUpdate(e:Event):void {
  5. if (inputfield.textHeight > inputfield.height) inputfield.text = prevText;
  6. else prevText= inputfield.text;
  7. }

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.