/ Published in: ActionScript 3

I borrowed this example from the link above
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// Import the required component classes. import fl.controls.Label; // Create a new instance of the Font1 symbol from the document's library. var myFont:Font = new MyFont(); // Create a new TextFormat object, and set the font and size properties. var myTextFormat:TextFormat = new TextFormat(); myTextFormat.font = myFont.fontName; myTextFormat.size = 8; /* Create a new Label component instance, set the textField.antiAliasType property, set the embedFonts and textFormat styles, and add the label to the display list. */ var myLabel:Label = new Label(); myLabel.text = "The quick brown fox jumped over the lazy dog"; myLabel.autoSize = TextFieldAutoSize.LEFT; myLabel.move(10, 10); myLabel.textField.antiAliasType = AntiAliasType.ADVANCED; myLabel.setStyle("embedFonts", true); myLabel.setStyle("textFormat", myTextFormat); addChild(myLabel);
URL: http://www.adobe.com/devnet/flash/quickstart/label_component_as3/#section7
Comments
