textHeight property wrong?

Hi:

I need to distribute some images vertically parallel to a dynamic text field wich content is loaded from an XML file. The first image top-aligned, the last one bottom-aligned and equal gap between them. Easy, no? That’s what i thought but I’m banging my head as I can’t get it and my only guess is the textHeight property has a wrong value

I calculate the gap between images with:

imgGap = (txtHeight - imgsHeight) / (nImgs - 1);

the problem is that the first 8 images reach the textfield bottom:
1046 px (the sum of the first 8 images)
1281 px (7 gaps x 183)

2327 px versus the textHeight property being 4646 px (numLines x getLineMetrics(0).height = 4665)

Any idea what’s wrong? Thanks in advance

Traces
height: 310
textHeight: 4646
numLines: 311
getLineMetrics(0).height: 15
maxScrollV: 291

imgsHeight: 2080
nImgs: 15
imgGap: 183

setTextFormat();
[INDENT]…
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
xmlLoader.load(url);[/INDENT]
}

private function LoadXML(par:Event):void {
[INDENT]var xmlData:XML = new XML(par.target.data);
buildInterface(xmlData);[/INDENT]
}

private function buildInterface(xmlData:XML):void {
[INDENT]…
setTexto(xmlData.texto);
…[/INDENT]
}

private function setTexto(texto:String):void {
[INDENT]item_txt = new TextField();
item_txt.embedFonts = true;
item_txt.defaultTextFormat = textDef_fmt;
item_txt.x = txtLeft;
item_txt.y = txtTop;
item_txt.width = txtWidth;
item_txt.height = txtHeight; // 310 px
item_txt.multiline = true;
item_txt.wordWrap = true;
item_txt.antiAliasType = AntiAliasType.ADVANCED;
item_txt.gridFitType = GridFitType.PIXEL;
item_txt.sharpness = 0;
item_txt.htmlText = texto;
item_txt.selectable = false;
item_txt.mouseEnabled = false;
addChild(item_txt);
// 2/9/09: equal gap between images
trace("height: ", item_txt.height);
trace("textHeight: ", item_txt.textHeight);
trace("numLines: ", item_txt.numLines);
trace("getLineMetrics(0).height: ", item_txt.getLineMetrics(0).height);
trace("maxScrollV: ", item_txt.maxScrollV);
if (sp != null) sp.txtHeight = item_txt.textHeight; // set the text height for the class wich loads and show images
if (item_txt.maxScrollV > 1) setScroll();[/INDENT]
}

private function setTextFormat() {
[INDENT]txtFont = new menuItems();
textDef_fmt = new TextFormat();
textDef_fmt.font = txtFont.fontName;
textDef_fmt.color = 0x58595B;
textDef_fmt.size = 11;
textDef_fmt.letterSpacing = 1;
textDef_fmt.leading = 4;
textDef_fmt.kerning = true;
textDef_fmt.align = “left”;
textDef_fmt.leftMargin = 0;
textDef_fmt.rightMargin = 25;[/INDENT]
}