Archive for the 'flash' Category

Embedding fonts for AS3 in Flash CS3 IDE - Back to Basics

Wednesday, October 28th, 2009

I realise that there are lots of fancy ways to embed fonts these days for Flex, AS3, SWC files, etc. But if it all gets a little confusing, you might consider a very simple alternative when working from the Flash IDE. (This works in Flash CS3 but presumably works the same way in CS4).

Using this technique, you can use the font anywhere in your project, including inside other swc components. As for limitations: As I said, this is the “Easy” way to embed fonts, not necessarily the best way for all circumstances. e.g. If you are using many fonts or fonts with very large character sets this will result in very slow compile times and large file sizes. But in the majority of cases, this is a nice light, flexible, simple way to embed your fonts. Click here to download the sample fla for embedding fonts for AS3 in Flash CS3 IDE.

  1. In the libary options, choose “New Font”
  2. Choose the font you want to use from the dropdown and set the name of the font to be exactly the same as the dropdown value (making these identical just makes things easier). For this example we will use “Arial”
  3. Set linkage options: Embed for actionscript = true, Export in first frame = true, Class = Arial, Base Class = flash.text.Font. This ensures the font gets compiled into your swf.
  4. Create text field and text format as follows (obviously this is just an example, there’s more than one way to skin a cat)var textField:TextField = new TextField();
    var format:TextFormat = new TextFormat();format.font = ‘Arial’;
    format.color = 0xEDEDED;
    format.size = 60;
    format.align = ‘center’;textField.defaultTextFormat = format;
    textField.alpha = 0.8;
    textField.selectable = false;
    textField.embedFonts = true;
    textField.text = ‘Hello World’;

Font resources online:

Find Font by Sight

www.ITCFonts.com

Flash IDE loves Flex 3 SDK with SWC compiled components

Tuesday, August 18th, 2009

FORTUNE MAGAZINE LABELS SUNGEVITY “THE DELL OF SOLAR ENERGY”

Wednesday, June 4th, 2008

Console Logging for Flash (i.e. Tracing in a browser)

Monday, May 26th, 2008

Thanks Flash Gurus

Thursday, May 1st, 2008

JSON for Actionscript 2 update to fix ordering bug of object properties

Thursday, May 1st, 2008

HOME | CONTACT Copyright © 2010 Extro Interactive