# createTextField + TextFormat + embedFonts=true

**URL:** <https://forum.kirupa.com/t/createtextfield-textformat-embedfonts-true/213714>\
**Category:** flash\
**Created:** [January 22, 2007, 6:51pm UTC](https://forum.kirupa.com/t/createtextfield-textformat-embedfonts-true/213714 "2007-01-22T18:51:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dalewb](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/dalewb/32/3029_2.png) [@dalewb](https://forum.kirupa.com/u/dalewb)\
**Post date:** [January 22, 2007, 6:51pm UTC](https://forum.kirupa.com/t/createtextfield-textformat-embedfonts-true/213714/1 "2007-01-22T18:51:19Z")

</div>

I have a shared library that has been imported for runtime sharing that contains the font shFont\_Verd. I want to embed this into a new dynamic text field created at runtime with the following code that doesn’t seem to work yet:

```auto

onClipEvent(load){
    var TxtFld = this.dyBtnMC.createTextField("dyBtnText", getNextHighestDepth(), 0, 0, 125, 30);
    
    var myFormat:TextFormat = new TextFormat();    
    myFormat.font = "shFont_Verd";
    
    with(TxtFld){
        setTextFormat(myFormat);
        /*embedFonts=true;*/
        html=false;
        multiline=false;
        text="this is a test button";
        selectable=false;
        border=false;
        background=false;
        autoSize="center";
        var HexColor:String = "FFFFFF"
        textColor=parseInt("0x" + HexColor);
    }
}

```

Yes, I know it’s on a movieclip. I’ll try to figure out how to put it on the timeline once I get all the kinks ironed out of this code…
