# Can't get TextFormat working

**URL:** <https://forum.kirupa.com/t/cant-get-textformat-working/225866>\
**Category:** flash\
**Created:** [May 16, 2007, 10:59am UTC](https://forum.kirupa.com/t/cant-get-textformat-working/225866 "2007-05-16T10:59:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimjiminyjimjim](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@jimjiminyjimjim](https://forum.kirupa.com/u/jimjiminyjimjim)\
**Post date:** [May 16, 2007, 10:59am UTC](https://forum.kirupa.com/t/cant-get-textformat-working/225866/1 "2007-05-16T10:59:11Z")

</div>

This is a bit of code that lets the user click somewhere and type in some text. Everything in my code works except I can’t seem to set the text format. It defaults to Times New Roman. Do I need to embed the fonts or something?

Any help would be much appreciated. Thanks.

```auto

i = 0;

mcDraw.onPress = function() {
i++
var xpos = _root._xmouse;
var ypos = _root._ymouse;

var my_fmt:TextFormat = new TextFormat();
my_fmt.color = 0xFF0000;
my_fmt.font = "Arial";
my_fmt.bold = true;

_root.createTextField("my_txt_"+i, i, xpos, ypos,(500-xpos),10);
_root["my_txt_"+i].autoSize= true;
_root["my_txt_"+i].multiline = true;
_root["my_txt_"+i].wordWrap = true;
_root["my_txt_"+i].type = "input";
_root["my_txt_"+i].setTextFormat(my_fmt);

Selection.setFocus(_root["my_txt_"+i]);
}

```
