0 Replies Latest reply on Jul 24, 2006 2:35 PM by MontrealDude

    Problem with dynamic html text

      Here's the catch, Flash seems to automatically reformat html text you dynamically throw at it. For example, if you do :


      var ORIGINAL_TEXT_FIELD:String = "originalTextField";
      var FLASH_FORMATTED_TEXT_FIELD:String = "flashFormattedTextField";
      var htmlString:String = '<P ALIGN="LEFT"><FONT FACE="Arial" SIZE="18" COLOR="#000000" LETTERSPACING="0" KERNING="0">Thi<FONT COLOR="#BA0000">s<FONT FACE="Courrier"> is my</FONT></FONT><FONT FACE="Courrier">test</FONT> text</FONT>';

      createTextField(ORIGINAL_TEXT_FIELD, 0, 0, 0, 500, 50);
      this[ORIGINAL_TEXT_FIELD].type = "dynamic";
      this[ORIGINAL_TEXT_FIELD].html = true;
      this[ORIGINAL_TEXT_FIELD].border = true;
      this[ORIGINAL_TEXT_FIELD].htmlText = htmlString;

      createTextField(FLASH_FORMATTED_TEXT_FIELD, 1, 0, 75, 500, 50);
      this[FLASH_FORMATTED_TEXT_FIELD].type = "dynamic";
      this[FLASH_FORMATTED_TEXT_FIELD].html = true;
      this[FLASH_FORMATTED_TEXT_FIELD].border = true;

      If you trace :


      at the end and compare it to the value of htmlString then you can see that the two are really different.

      I am actually trying to build a rich text editor with flash and this problem is really getting to me.

      By the way, this works in Flash 8 so I think that it's a Flash bug and that maybe someone would know about a workaround to this ?

      Any ideas as of what the problem is ? Any help or hint would be greatly appreciated.