Posted By

martin9999uk on 01/10/11


Tagged

limit TextField as3


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

kure69


Limit lines in a textfield


 / Published in: ActionScript 3
 

  1. var prevText:String;
  2. inputfield.addEventListener(Event.CHANGE, onUpdate);
  3.  
  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  

You need to login to post a comment.