The following example shows how you can use an embedded font with the Flash ActionScript 3.0 TextArea control.
Full code after the jump.
Note: The following example requires a TextArea control in your Flash document’s library, as well as an embedded font with the linkage class set to “ChaparralProEmbedded”.
// ActionScript 3.0 import fl.controls.TextArea; var chaparralProEmbeddedFont:Font = new ChaparralProEmbedded(); var textFormat:TextFormat = new TextFormat(); textFormat.font = chaparralProEmbeddedFont.fontName; textFormat.size = 32; var textArea:TextArea = new TextArea(); textArea.setStyle("textFormat", textFormat); textArea.setStyle("embedFonts", true); textArea.text = "The quick brown dog jumps over the lazy fox."; textArea.move(10, 10); textArea.setSize(300, 200); addChild(textArea);
{ 3 comments… read them below or add one }
Anybody can help me in how to Reading Text files using action script.
@Bhavya
In Flash authortime, make sure you have the TextArea component in your library, stick this code on your main timeline and publish. Course you’ll need a text file to load too.
thank you so much.
works like a charm….:-)