WHAT'S NEW?
Loading...

Embed Font as3


// ActionScript 3.0
/* Requires:
 * - TextInput component in Flash library
 * - Embedded font with class name "MyEmbeddedFont" in Flash library
 */
import fl.controls.TextInput;
 
var embeddedFont:Font = new MyEmbeddedFont();
 
var textFmt:TextFormat = new TextFormat();
textFmt.color = 0xFF0000;
textFmt.font = embeddedFont.fontName;
textFmt.size = 18;
 
var textInput:TextInput = new TextInput();
textInput.text = new Date().toString();
textInput.setStyle("embedFonts", true);
textInput.setStyle("textFormat", textFmt);
textInput.width = 300;
textInput.move(10, 10);
addChild(textInput);

0 komentar:

Post a Comment