Superscript and subscript with dynamic flash text

We recently came across an old issue that I’ve experienced with flash, dynamic text, and superscripts before, but some of our other developers had never seen before, so I thought I would create an entry for posterity’s sake.

The issue is as follows, you want to enter superscript into an HTML enabled text field, so you add a sup tag around the text you want to superscript. You compile your file and no text appears where you expect it to. Turns out, sup and sub tags are not supported by a textfield that is dynamically populated.

Oh crap. What to do?

Well, don’t fret!

Download these fonts, install, and restart Flash. Next you need to embed the fonts in the SWF. There are many ways to do this that are well documented. My preferred method is to open your FLA and create a dynamic textfield, setting the font to the desired super or sub font. Then include the characters you want to publish (typically, I just need numerals). Limiting the characters you include will limit the file size of the resulting SWF.

Use the following html tag to set the super or sub font. For instance,
This text requires a footnote <font face=”GG Superscript Sans”>1</font>

Voila, you’re ready to add super or sub scripted fonts to your flash.

Comments are closed.