GG's Flash Blog

04/19/07

How to use subscript & superscript in dynamic and input text field

Permalink 05:51:49 pm, Categories: ActionScript, Flash & HTML, 221 words

Issue:

  • Unable to use subscript or superscript in dynamic and input text field.
  • Unable to display subscript or superscript for external loaded text.
  • Unable to use <sub> & <sup> tags in dynamic or input text field.

Reason:
<sub> & <sup> tags are not supported by Flash.

TechNote: Subscript and superscript fail in dynamic and input text fields
LiveDocs: Supported HTML tags

Solution:

  1. Download & install GG Subscript & GG Superscript TrueType fonts. You will need to restart Flash software after installed fonts.

  2. Create a dynamic text field with Arial font embeded. Set the HTML property to true.

  3. Create a dynamic text field with GG Subscript font embeded.

  4. Create a dynamic text field with GG Superscript font embeded.

  5. Use HTML tag to set text to subscript or superscript like below:

    Adobe<font face="GG Superscript">TM</font>

    If you are using ActionScript to test the htmlText, use script like below:

    my_txt.text = "Adobe<font face=\"GG Superscript\">TM</font>";

View sample: superscript.swf
Download sample: superscript.fla superscript.swf

NEW! (2008-09-21)
A new set of superscript & subscript fonts includes both sans & serif type, with more complete & improved glyphs, standard scale & shift, is now available to be downloaded (free) from here.

Comments, Pingbacks:

Comment from: Aisha [Visitor]
Thanks sooo much, I just had a very disappointing experience when I found that my way of importing various unicode characters from text files only worked on Macs, and I was at a loss - but you fixed the subscript/superscript part of my problem (the biggest part). Thanks again
Permalink 07/13/07 @ 22:27
Comment from: senthil kumar [Visitor] Email
Just now im hearing this superscript along with the flash. Nice to learn
Permalink 08/21/07 @ 17:32
Comment from: Yin [Visitor] Email
wow. you totally made my day. I've been trying to put subscripts in all week!! Thanks so much!
Permalink 11/08/07 @ 06:27
Comment from: GW [Visitor]
Works great! You made my day. Thanks so much.
Permalink 12/21/07 @ 01:09
Comment from: Aaron Beall [Visitor] Email · http://abeall.com
You don't know how long I've been looking for these two fonts. Well, I'll tell you: about the last 4 years. All other hacks I've tried have had issues. Thank-you very much for sharing!!

- aaron
Permalink 01/24/08 @ 11:17
Comment from: flo [Visitor] Email
Couldn't believe there's no native support for subscript tags in flash. You helped me out... thank you so much!

flo
Permalink 02/13/08 @ 19:01
Comment from: priti [Visitor] Email
thank u so much.
Permalink 05/30/08 @ 19:42
Comment from: G [Member] Email
Here is a nice solution for using GG superscript & GG subscript with <sup> & <sub> tag

http://www.psyked.co.uk/adobe/flash/superscript-and-subscript-with-actionscript.htm
Permalink 07/12/08 @ 18:28
Comment from: G [Member] Email
Also work in flex

http://jasonbejot.com/?p=3
Permalink 07/12/08 @ 18:32
Comment from: Wally [Visitor] Email
thats good
Permalink 09/28/08 @ 20:26
Comment from: Evan Gifford [Visitor] Email · http://blitzagency.com
Nice tip, it's a real timesave. Thank you very much!
Permalink 10/23/08 @ 07:57

This post has 2 feedbacks awaiting moderation...

Your email address will not be displayed on this site.
Your URL will be displayed.

Allowed XHTML tags: <p, ul, ol, li, dl, dt, dd, address, blockquote, ins, del, span, bdo, br, em, strong, dfn, code, samp, kdb, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small>
(Line breaks become <br />)
(Set cookies for name, email and url)
(Allow users to contact you through a message form (your email will NOT be displayed.))

Next post: Cross-domain policy

Flash Reference

To share what I have learned from people who have shared.

 << <November 2008> >>
Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30            

Search

Categories

Archives

Who's Online?

Account

Syndicate this blog

Donation

If you find GG's Flash extensions or any of our resources useful, help support future development by making a donation.

Ads



Valid XHTML || Valid CSS || Valid RSS || Valid Atom

Copyright © 2006/2007 GGSHOW. All Rights Reserved.
GGSHOW.COM | GGSHOW.NET
YaToXi | eBoaY | tuBabe | syndicater | Nobodys | NeverTheLink | NiShiZuiHaoDeNiZhiDaoMa | WorldCoin