On Jun 13, 2007, at 10:51 AM, matt stuehler wrote:
In other words, if you're using a device font, Flash will properly calculate the height if the font is _sans, _serif, or _typewriter (which is exactly what you suggested); but not if you use another font.
This little bit of code properly calculates the height of a text field in Flash - snagged from one of the components in the V2 framework (DataGrid?)
public function getTextHeight(txtField:TextField):Number { var oldText = txtField.text; txtField.text = "^g_p"; var tH = txtField.textHeight + 4; txtField.text = oldText; return tH; } cheers, jon _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com