title: Finding the actual text height AS3
body: <p>How can I get the actual height of a text in AS3 TextField? It appears that TextField.textHeight reports some fixed value that doesn't depend on the contents of a TextField. </p>
  
  <p>The example code below produces the following:</p>
  
  <pre><code>text=o p g y d j
  textWidth=120.8
  textHeight=**96**
  
  text=o
  textWidth=15
  textHeight=**96**
  
  text=oW
  textWidth=43.3
  textHeight=**96**
  </code></pre>
  
  <p>Obviously, the height should be different for "o" and "p", etc.</p>
  
  <p>The AS3 code:</p>
  
  <pre><code>import flash.text.TextField;
  
          var format : TextFormat = new TextFormat();
          format.font = "Times New Roman";
          format.size = 30;
          format.align = TextFormatAlign.CENTER;
  
  
          var textField1 : TextField = new TextField();       
          textField1.defaultTextFormat = format;      
  
          textField1.selectable = false;              
          textField1.sharpness = 0;   
          textField1.embedFonts = true;   
          textField1.multiline = false;
  
          textField1.height = 50;
          textField1.width = 200;
          textField1.x = 10;
          textField1.y = 10;
  
          addChild(textField1);
  
          textField1.text = "o p g y d j";    
          trace("text=" + textField1.text);
          trace("textWidth=" + textField1.textWidth);
          trace("textHeight=" + textField1.textHeight);       
  
          textField1.text = "o";      
          trace("\ntext=" + textField1.text);
          trace("textWidth=" + textField1.textWidth);
          trace("textHeight=" + textField1.textHeight);   
  
          textField1.text = "oW";     
          trace("\ntext=" + textField1.text);
          trace("textWidth=" + textField1.textWidth);
          trace("textHeight=" + textField1.textHeight);       
  
          stop();
  </code></pre>
  
  <p>I guess TextField.textHeight is not the right variable, but what should I use instead?</p>