package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFieldAutoSize; import flash.text.TextFieldType; import flash.text.TextFormat; [SWF(width="250", height="200", backgroundColor="0xffffff")] public class TFBug extends Sprite { private var tf:TextField; private var style:TextFormat; public function TFBug() { tf = new TextField(); tf.autoSize = TextFieldAutoSize.LEFT; tf.border = true; tf.multiline = true; tf.wordWrap = true; tf.width = 150; tf.type = TextFieldType.INPUT; // tf.type = TextFieldType.DYNAMIC; // This will not produce the bug style = new TextFormat("Verdana"); tf.htmlText = "

My Test

"; // test var str:String = tf.text; if(str.indexOf("\r",str.length-1) != -1 ){ trace("Found a stupid \\r-char at the end of my textfield"); } // workaround // tf.htmlText = tf.htmlText.substring(0,tf.htmlText.length-1); this.addChild( tf ); } } }