# Can't get accurate mc height

**URL:** <https://forum.kirupa.com/t/cant-get-accurate-mc-height/258574>\
**Category:** Uncategorized\
**Created:** [April 25, 2008, 10:21am UTC](https://forum.kirupa.com/t/cant-get-accurate-mc-height/258574 "2008-04-25T10:21:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxelcat](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/maxelcat/32/2854_2.png) [@maxelcat](https://forum.kirupa.com/u/maxelcat)\
**Post date:** [April 25, 2008, 10:21am UTC](https://forum.kirupa.com/t/cant-get-accurate-mc-height/258574/1 "2008-04-25T10:21:48Z")

</div>

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

```auto

[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]

```
