5 Replies Latest reply on Nov 14, 2009 10:06 PM by kglad

    Embedding a font


      I've searched the web and tried a number of different approaches to embed a font in my Flash movie but each has ended in frustration. I have created several buttons with dynamic text fields that use the font I need. I have added the font to my library, given it a unique name, exported for actionscript and then used the unique name when selecting the font in my dynamic text fields.


      I am probably not using the right AS code to embed and use the font. What's the easiest way to embed the font?


      I am also using the same embedded font in a around 5 flash movies on the site.


      Thanks for your suggestiuons.



        • 1. Re: Embedding a font
          kglad Adobe Community Professional & MVP

          the easiest way is to click on the textfield, click on the embed.. button in the properties panel, select the needed characters and click ok.


          that won't work for textfields created with code.  there is no easy way to embed fonts for those textfields.  you have to carefully follow several steps.

          • 2. Re: Embedding a font
            samgliksman Level 1

            That's what I am doing but it doesn't seem to be working. I embed the entire upper or lowercase but the default Times Roman is displaying on clients that don't have the font.

            - I add the font to the library, selecting export for actionscript

            - I use the library font in my dynamic text fields (which are in buttons)

            - I embed the entire character set


            Do I need to add any AS code?

            • 3. Re: Embedding a font
              kglad Adobe Community Professional & MVP

              the textfield that has the embedded font should display without problem.


              if you have other textfields that you want to use that font, you must create a textformat instance, assign its font property to match the linkage id of the library font and then you must enable the other textfield's embedFonts property and you must assign the setTextFormat() and/or setNewTextFormat() methods to your other textfields.

              • 4. Re: Embedding a font
                samgliksman Level 1

                The old flash file was cached - once I deleted it the fix worked.


                There was so much mis-information on the web. It really was pretty simple once I got the right directions. Thanks so much.

                • 5. Re: Embedding a font
                  kglad Adobe Community Professional & MVP

                  you're welcome.