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.
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]);
}