0 Replies Latest reply on Dec 22, 2010 9:53 AM by poloop

    Problem with TLFTextField, textFormat and lineBreak

    poloop Level 1

      Hye,

       

      I've got a little problem with one of my fla file. I put in a fla a TLFTextfield with a multiline scrap text, then I change the text and the font. But when I change the textTFormat, the linebreaks of the text became "new paragraph" whereas I'd just like a "new line".

       

      Are there any properties to set to keep linebreak  as "new line"?

       

      Just bellow the code I used :

       

      public static function setTLFTextField(textField : TLFTextField, fontFamily : String, value : String, embed : Boolean = true, html : Boolean = false) : void
      {
           var selectable : Boolean = textField.selectable;
           textField.selectable = true;
           var textFormat : TextFormat = textField.getTextFormat();
           textFormat.font = fontFamily + "_" + locale;
           textFormat.letterSpacing = (isNaN(textFormat.letterSpacing as Number))? 0 : textFormat.letterSpacing;
      
           textField.embedFonts = embed;
           /*if (!html)
                textField.text = value;
           else
                textField.htmlText = value;*/
                     
           textFormat.display = "none";
           textField.setTextFormat(textFormat);
           textField.selectable = selectable;
                     
      }
      

       

       

      Thanks for your help....