Hi!
I want to make my createTextField centered on my movieclip, does anyone know how this is done? I’ve tried using the texWidth/_width property but it only makes it to narrow. Or is it possible to size the background fill to the length of the word?
var aPoints:Array = ["one", "two", "three", "four"];
function printIt() {
for (var i = 0; i<aPoints.length; i++) {
_root.createEmptyMovieClip("box"+i+"_mc", this.getNextHighestDepth());
var myCurrClip = _root["box"+i+"_mc"];
myCurrClip.createTextField("my_txt", 1, 0, 0, 100, 40);
myCurrClip.my_txt.autoSize = true;
myCurrClip.my_txt.border = false;
var my_fmt:TextFormat = new TextFormat();
my_fmt.color = 0xB80000;
my_fmt.size = 20;
my_fmt.font = "verdana";
my_fmt.align = "center";
myCurrClip.my_txt.text = aPoints*;
myCurrClip.beginFill(0x224488, 100);
myCurrClip.moveTo(0, 0);
//This is no good way of setting the size ...
myCurrClip.lineTo(myCurrClip.my_txt.textWidth*3, 0);
myCurrClip.lineTo(myCurrClip.my_txt.textWidth*3, 30);
myCurrClip.lineTo(0, 30);
myCurrClip.endFill();
myCurrClip._y = 10+50*i;
myCurrClip._x = 10;
myCurrClip.my_txt.setTextFormat(my_fmt);
}
}
printIt();
kind regards, ollu