this is old bug of flash
in flash8 it's not that present tho i guess I've seen it few times
anyways, simple touching that property before actual use helps. as simpel as
trace(txt._height) make textfield report correct value

2006/11/13, Muzak <[EMAIL PROTECTED]>:

Create a second textfield (hidden) that is as wide as the original, is
only one line high and does not autosize, dump the text in it
and grab its maxscroll value.

regards,
Muzak

----- Original Message -----
From: "grimmwerks" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" <flashcoders@chattyfig.figleaf.com>
Sent: Sunday, November 12, 2006 8:09 AM
Subject: [Flashcoders] frustrated with textFields: getting height while
textisn't fully 'there'


> This is totally driving me crazy.
>
> I'm creating a textfield as a sub to another clip, setting it's width,
> making it autosized, giving it a stylesheet. I then toss in it's
> htmlText.
>
> I just want to know if the darn thing is one or more lines. Trouble is
> it's not reporting back properly...it seems as if it's just in the
> middle of adjusting itself or something, as if I trace out a lot of
> stuff, it works out fine. But I shut off tracing, and it stops
> working.
>
> For example:
>
> var mTitle:TextField = mcTxt.createTextField("mc_title", 6, tR.x+20,
> tR.y-14, 230, 0);
> mTitle.autoSize = "right";
> mTitle.wordWrap=true;
> mTitle.selectable=false;
> mTitle.html = true;
> mTitle.border=true;
> mTitle.multiline = true;
> mTitle.styleSheet =_global.gPrefs.CSS;
> mTitle.htmlText = title;
>
> fontsize = 30; // i know this
> lCnt = (mTitle.textHeight/fontSize);
>
> Sometimes lCnt works and sometimes it doesn't -- and I'm tracing out
> all elements.
>
> I've even tried to do something like
> while(mTitle.htmlText!=title){
>  trace("not there");
> }
>
> But that doesn't work either.
> _______________________________________________


_______________________________________________
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

_______________________________________________
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

Reply via email to