5 Replies Latest reply on Apr 21, 2006 12:29 PM by TimSymons

    TextFormat to HTML problem

    lmtc
      Hi.

      Using the textformat object, Flash uses the "SIZE=" parameter instead of "FONTSIZE=" parameter to indicate font size in regards to a html text field. However, when internet browsers see the size field the text is rendered extraodinarily large.

      Is there a patch or fix for the Font size problem, other than having to programmatically search through the text field, find the "SIZE=" parameter, and literally change it to "FONTSIZE=" before it can be properly display in a browser?

      Thanks, regards

      LMTC
        • 1. Re: TextFormat to HTML problem
          mxcdesigns
          did you try to use a . before you set the size of it?
          • 2. Re: TextFormat to HTML problem
            lmtc Level 1
            Not sure what you mean? I am new to flash.
            • 3. Re: TextFormat to HTML problem
              TimSymons Level 1
              If you want to render HTML text in Flash you have to set the html property of your TextField to true and then you can use normal HTML tags (though it is a very limited set of tags).

              For example, let's say you have a TextField named "tf".

              tf.html = true; // This allows you to use HTML tags.
              tg.htmlText = "<font size='3'>My Text</font>";

              Tim
              • 4. Re: TextFormat to HTML problem
                lmtc Level 1
                Yep, I know how to render html using flash textboxes.

                But, the problem occurs when you take what flash generates in those text boxes and ask internet explorer to display it.
                See my first message to understand what the original problem is.

                To get around the problem I used php to change the "size=" tag to "fontsize=" before passing the flash generated htmltext
                to a simple web page, e.g.

                //replace the html "SIZE=" parameter generated by flash to a "FONTSIZE=" parameter in the <FONT> tag
                $sFontFix = str_replace('SIZE=', 'FONTSIZE=', $sOriginalText);
                $sOriginalText = $sFontFix;

                <TEXTFORMAT LEADING="0"><P ALIGN="LEFT"><FONT FACE="Arial" SIZE="10" COLOR="#CC00FF" LETTERSPACING="0" KERNING="0">

                becomes.....

                <TEXTFORMAT LEADING="0"><P ALIGN="LEFT"><FONT FACE="Arial" FONTSIZE="10" COLOR="#CC00FF" LETTERSPACING="0" KERNING="0">


                Regards

                LMTC
                • 5. Re: TextFormat to HTML problem
                  TimSymons Level 1
                  Oh. Sorry for the confusion.

                  Tim