The Cornerstone for Creative Christians
AlteredEgg.com
Home
How to Embed Multiple Fonts in Dynamic Text Fields in Flash

As of Flash 8, embedding multiple fonts for use in an HTML text field is still not as easy as it should be. The documentation makes it too complicated, and I found some people doing it with CSS styles and with the TextFormat object , but I believe I've found a better way.

  1. Create your dynamic text field and check the "show as HTML" button.
  2. Insert some dummy text and apply formatting of every sort you intend to use, i.e. highlight different words, applying bold, italic, new fonts as necessary.
  3. On the Embed menu, tell it to embed whatever characters you desire. When Flash exports the text box, it will include the fonts that you used in your dummy text.

That's it, if you don't need a lot of Actionscript control. If you DO need more control, follow these instructions:

  1. In the contextual menu for your Library palette, select "New Font". Give it a unique name without spaces and select the font to embed. Hit OK.
  2. Right click the font in the Library and click "Linkage". Check "Export for Actionscript". Your unique name should now appear in the identifier field. Repeat steps 1 and 2 for all your desired fonts.
  3. Place an instance of a text field on your stage and give it an instance name. Make sure the HTML box is checked. Then you need to write some ActionScript on a keyframe like so:
    		theTextField.embedFonts=true; theTextField.htmlText="";
    		
  4. Type some sample text in the text field. You need to have some sample text from every font you intend to use. Do this by highlighting the text and selecting YOUR EMBEDDED FONT from the font list. YOU WILL KNOW IT IS YOUR EMBEDDED FONT BY THE ASTERISK(*) AT THE END OF THE NAME.
  5. Now your fonts are available in the text field. The HTML you insert into it can be formatted like so:
    		<font
    		size='21' color='#cc092f' face='Eurostile'>Font in
    		Eurostile.</font><font size='21' color='#cc092f'
    		face='Birch'>Font in Birch.</font> 
    		
    Note that the asterisk is not required in the HTML. Remember that if you want to use special characters you need to use numerical HTML entities (e.g.: &123;) rather than the keyword-based kind (e.g.: &emdash).

 





Digg!Reddit!Del.icio.us!Facebook!Slashdot!Netscape!Technorati!StumbleUpon!Newsvine!Furl!Yahoo!Ma.gnolia!Free social bookmarking plugins and extensions for Joomla! websites!
Comments
Add New Search
Thanks
TB 2010-03-12 11:13:44

***, it works brilliantly! I have been seeking for a solution to use different fonts in a flash slideshow where fonts (as well as color and size) are determined in an external XML file and this works like gem.

Praise
the Lord!
Write comment
Name:
Email:
 
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
Please input the anti-spam code that you can read in the image.

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

 
< Prev   Next >
[ Back ]

We want your stuff!
Follow us on Twitter:

@confidant_ca (business)
@alteredegg (fun)

Main Menu
Home
What is This Website?
Bookmarks
Send Us Your Stuff!
Why is Jesus So Important?
News, Commentary & Weird
Famous Christian Creatives
Contact Us
Site Map
Interesting Stuff For:
Actors
Animators & Filmmakers
Architects
Artists
Cartoonists
Clothing Designers
Dancers
Graphic Designers
Illustrators
Multimediacs
Musicians
Photographers
Poets
Preachers
Writers
Login Form





Lost Password?