Using an embedded font with the ColorPicker component in Flash using ActionScript 3.0

by Peter deHaan on December 6, 2008

in ColorPicker

The following example shows how you can use an embedded font with the Flash ColorPicker component using ActionScript 3.0.

Full code after the jump.

// ActionScript 3.0
import fl.controls.ColorPicker;
import fl.events.ColorPickerEvent;
 
var arialEmbeddedFont:Font = new ArialEmbedded();
 
var fmt:TextFormat = new TextFormat();
fmt.font = arialEmbeddedFont.fontName;
fmt.color = 0xFF0000;
 
var colorPicker:ColorPicker = new ColorPicker();
colorPicker.setStyle("textFormat", fmt);
colorPicker.setStyle("embedFonts", true);
colorPicker.move(20, 20);
addChild(colorPicker);

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Previous post: Creating a selectable Label instance in Flash using ActionScript 3.0

Next post: Drawing shapes using the drawing API in ActionScript 3.0 and ActionScript 2.0