# AS3 TextField & embedFonts

**URL:** https://forum.kirupa.com/t/as3-textfield-embedfonts/319956
**Category:** flash
**Created:** [March 9, 2011, 9:16pm UTC](https://forum.kirupa.com/t/as3-textfield-embedfonts/319956 "2011-03-09T21:16:47Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![RedGiant](https://avatars.discourse-cdn.com/v4/letter/r/b19c9b/32.png) [@RedGiant](https://forum.kirupa.com/u/RedGiant)
#### Post date: [March 9, 2011, 9:16pm UTC](https://forum.kirupa.com/t/as3-textfield-embedfonts/319956/1 "2011-03-09T21:16:47Z")

</div>

I have been toying around with being able to see embedded fonts over different machines, and came a question. Is there a way to use an embedded font for a TextField that is placed in a movieclip that is exported for ActionScript in CS5?

I created a movieclip on the stage, that contains a TextField called _tf_.  
Then exported this movieclip for use in ActionScript. This movieclip’s class is called _TF\_Container_

Then I embedded and exported for AS a font called _NeonFont_.

```auto

var myfont:Font = new NeonFont;
var myformat:TextFormat = new TextFormat();
var myclip:MovieClip = new TF_Container();

//style my TextFormat
myformat.font=myfont.fontName;
myformat.size=26;
myformat.color=0x000000;

//referencing the TextField, tf, I inserted in the FLA file
myclip.tf.defaultTextFormat=myformat;
myclip.tf.embedFonts=true;

addChild(myclip);
myclip.tf.text="Why does this not work?"

```

I uploaded the SWF to my page from a Mac. I checked it from a PC, and it was switched to a default font.
