Disappearing HTML Text in Flash

26th October 2005

Bold and Italic HTML text sometimes disappears from a textfield. Here’s a brief tutorial that tries to explain why this happens and more importantly how you can stop it.

The problem occurs when you are using an HTML textfield that has font outlines included. By including font outlines you can ensure that your chosen font will be displayed, even if the user viewing the movie does not have that particular font installed on their machine.

Font outlines can be included from the “Character Options” dialog box, opened from the Character button in the Textfield properties inspector (Flash MX2004 and MX)

However when you include outlines for a font Flash will only include the outlines for the font style variations (bold, italic, bold and italic) used in the movie. That is, if your movie doesn’t contain a textfield (with font outlines included) that explicitly uses bold text, no bold font outlines will get included in the file.

If a textfield is setup so that it uses embedded font outlines, but is then used to display characters for which the outlines aren’t included in the movie. The characters that can’t be displayed using the embedded font outlines won’t be displayed at all. This is what is happening when bits of HTML text goes missing. The use of b and/or i tags in some HTML text can inadvertently create text that can’t be displayed — unless special care is taken to include all the font outlines that will be required — including the variations of bold and italic.

Ensuring Html Text Displays Correctly

One easy way you to do this is to creating a hidden textfield (maybe positioned off the edge of the stage) that contains text using all the variations in font styles that will be required for the movie.

To do this, create a textfield off the edge of the stage. From the Character Options dialog box choose to include font outlines for all the characters you need.

A hidden textfield can contain text using all the required font style variations

Then type some text into the textfield. Using the B and I buttons from the Text Properties inspector make some of this text bold, some italic and some both bold and italic. If you leave some of this text in regular all the possible variations in font style (for the chosen font) will now be included in the movie. With this done all the font styles can safely be used in HTML text.

Permalink. Posted on 26th October 2005 in Flash.

Comments

  1. If you have time, please let me know if there are any other instances that would keep the "disapearing text in html" fix from not working.

    Thanks,

    # Posted by arnolfo Santoro on 10th August 2006.

  2. Realy this tutorial helped me, before I was in trouble since morning.

    Thanks a lot

    Aamir

    # Posted by Aamir on 5th December 2006.

Sorry, comments for this item are currently closed.

Of Interest

Hangouts

Listening