Can't get accurate mc height

Hi

I am attempting to put a vertical menu bar, each made up of a text fields inside a mc. The mcs and text create fine, but I am having “FUN” trying to position them vertically.

In the snippet below you can see that I go round a loop and format the mcs etc - all works. However, when I use trace(linkBtn._height) I get the same value for every button and some are right, some are wrong.

Strangley If I pick one specific button out using the if(i==6) {… it tells me a different height (which happens to be correct)

What’s going on? And more importantly, how do I get the correct heights.

Thanks in advance

Edward


[LEFT]for (var i:Number = 0; i < RootNode.childNodes.length; i++) {
//get the text for the designMenu links                 
linkText = RootNode.childNodes*.firstChild.nodeValue;             
if (i == 0) {                 
designMenu.text = linkText;                 
designMenu.setTextFormat(btnRollOff_fmt);                 
designMenu.antiAliasType = "advanced";                 
designMenu.embedFonts = true;                 
trace(i + "=" + designMenu._height);             
} else {                
 //bring in a movie clip that will form the link                 
var linkBtn:MovieClip = attachMovie("link_mc", "linkBtn" + i, getNextHighestDepth());                 linkBtn.createTextField("linkTxt", getNextHighestDepth(), 0, 0, 169, 0);                 linkBtn.linkTxt.setNewTextFormat(btnRollOff_fmt);                 linkBtn.linkTxt.autoSize = "left";                 
linkBtn.linkTxt.wordWrap = "true";                 
linkBtn.linkTxt.border = "true";                 
linkBtn.linkTxt.antiAliasType = "advanced";               
linkBtn.linkTxt.embedFonts = true;                
 linkBtn.linkTxt.text = linkText;                
 trace(i + "=" + linkBtn._height);                 
if (i == 6) {                     
trace("number" + i + "=" + linkBtn._height);                 
}             
}         
}[/LEFT]