Responding again to my own posting... :-) 

I tried what I was thinking of below, and it works perfectly! Pixel-accurate
width is correctly returned every time. The same method can be used for
multiple entry fields, even with different typefaces or type styles as long
as those style parameters are passed to the auto-sized, off-stage
"measurement" field. 


-----Original Message-----
[mailto:[EMAIL PROTECTED] On Behalf Of Ville
Sent: Thursday, June 22, 2006 13:23
To: 'Flashcoders mailing list'
Subject: RE: [Flashcoders] getTextExtent weirdness

I was recently working on a project where .getTextExtent() would have come
handy, but like for others, it did not work for me. I dropped the issue at
that time, but have been thinking of trying to create an auto-size field off
the stage with the same text style parameters as the textInput component,
then copy characters (from the input component as they're typed) to the
auto-sized field, then measure the width of the auto-sized field. If the
width exceeds the maximum allowed pixel-width, then disallow further typing
into the component. I think it should work... has anyone tried this?


To change your subscription options or search the archive:

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training

Reply via email to