PDA

View Full Version : [AS3] TextField height



IanLiu
December 6th, 2006, 12:17 PM
How do I predict the TextField height? When I initiate one, it comes with 100 height, but I want to set it to the fonts height.

I have tried the autoSize, but some times it shrinks the text field to a very tiny one, and some times it stays at fonts height, but I can't set its width anymore...

Is there a solution to this problem?

Thanks,
Ian Liu.

Dazzer
December 6th, 2006, 01:29 PM
http://livedocs.macromedia.com/flex/2/langref/flash/text/TextField.html#textHeight

regards.

IanLiu
December 6th, 2006, 01:59 PM
Hmm,
this assumes that your text got a text inside it. So, I would do this, right?

my_txt.text = "Some text";
my_txt.height = my_txt.textHeight;
my_txt.text = "";


Not very elegant... but thanks!
I will try it.

numediaweb
April 17th, 2009, 08:43 AM
what about my_txt.htmlText especially when the input text contains the <BR/> tags? :


my_txt.htmlText ="this is lot of text <BR><BR> and
<BR>another text containing <br>";

it doesn't work!