0 Replies Latest reply on Jun 27, 2007 3:46 AM by asdlfj_sadkfj_lkdsaf

    Big problems with htmlText and paragrahs

    asdlfj_sadkfj_lkdsaf
      I'm in the process of writing a rich text editor, basically allowing the user to type in to a text field, then select a part of the field and apply size/colour/bold/italic/underline to it. This all works fine with the field set to html, as getting the textFormat from a html field seems to work, modifying this textFormat object and adding say italic = true to it etc all works fine, then reapplying the format to the Selection...all good.

      There are 2 problems though.

      As the field is htmlText, there are <p> tags around each text item/line of text. When a text field gets focus, with autosize set to "left" or anything other than "none"/false the field height jumps (I have the border visible) to show a second blank line...presumably flash is thinking that the <p> tag needs a carraige return at the end.

      So I wrote a function to remove the last <p> tags from the text content, this has cured the problem....but has caused a second issue.

      If a text field has the first character modified with either bold/italic/underline (doesn't affect it when the size or colour are changed as they appear within the font tag)...when the length of that field is changed, ie when the paragraph is removed from the end...the formatting of that first character is applied to all the text in the field.

      Any ideas on how to stop this?