Hmmm... yeah, I actually did create such a button and while the 
images had clearly loaded and were displayed the textHeight still 
didn't take them into account...   I also tried getting an actual 
reference to the sprite representing the img tag within the html 
using the getImageReference method of the textArea's textField 
member.  The height and width of the sprite were way larger than the 
actual height and width of the image for some reason... not sure why.

Unless anyone has any other ideas I think I'll resort to regular 
expressions to parse through img tags and just use mx:Image... (In 
my particular use case I'm either getting a single image link or 
some text so that will do for me...).  Alex I appreciate the help so 
far.
-James

--- In [email protected], "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Never actually tried it with images.  It might take several 
callLaters
> depending on when the image arrives.  I usually test this out by 
adding
> a button that prints out the textWidth/Height after I can see the 
final
> appearance.  If it works then, then I know it is a matter of 
figuring
> out how long to wait.  Otherwise, some other solution is needed.
> 
>  
> 
> ________________________________
> 
> From: [email protected] 
[mailto:[EMAIL PROTECTED] On
> Behalf Of jandersen1978
> Sent: Tuesday, November 20, 2007 6:08 PM
> To: [email protected]
> Subject: [flexcoders] Re: Determining textHeight and textWidth when
> htmlText contains images...
> 
>  
> 
> Alex,
> I appreciate the guidance! I've tried using callLater and it does
> seem to help for text-only values of htmltext in a textarea. 
However,
> it still seems to ignore the size of any images regardless of when 
I
> validate and check the textHeight value... Do you know of an 
example
> I can refer to?
> Thanks!
> -James
> --- In [email protected] <mailto:flexcoders%
40yahoogroups.com>
> , "Alex Harui" <aharui@> wrote:
> >
> > No, I let it finish the layout at its current shape, then ask 
for the
> > dimensions in a callLater. Invalidating probably won't help. 
Then if
> > you need to adjust, change the size and go through the whole 
sequence
> > again.
> > 
> > 
> > 
> > ________________________________
> > 
> > From: [email protected] <mailto:flexcoders%
40yahoogroups.com>
> [mailto:[email protected] <mailto:flexcoders%
40yahoogroups.com>
> ] On
> > Behalf Of jandersen1978
> > Sent: Tuesday, November 20, 2007 1:12 PM
> > To: [email protected] <mailto:flexcoders%
40yahoogroups.com> 
> > Subject: [flexcoders] Re: Determining textHeight and textWidth 
when
> > htmlText contains images...
> > 
> > 
> > 
> > So are you thinking of using callLater from within a creation 
> > complete handler that would then call invalidateSize which would 
> > kick off the measure method which would then have the 
appropriate 
> > textHeight available?
> > 
> > --- In [email protected]
> <mailto:flexcoders%40yahoogroups.com>
> <mailto:flexcoders%40yahoogroups.com>
> > , "Alex Harui" <aharui@> wrote:
> > >
> > > I use callLater to check after the control has rendered.
> > > 
> > > 
> > > 
> > > ________________________________
> > > 
> > > From: [email protected]
> <mailto:flexcoders%40yahoogroups.com>
> <mailto:flexcoders%40yahoogroups.com>
> > 
> > [mailto:[email protected]
> <mailto:flexcoders%40yahoogroups.com>
> <mailto:flexcoders%40yahoogroups.com>
> > ] On
> > > Behalf Of jandersen1978
> > > Sent: Monday, November 19, 2007 8:53 PM
> > > To: [email protected] <mailto:flexcoders%
40yahoogroups.com>
> <mailto:flexcoders%40yahoogroups.com> 
> > > Subject: [flexcoders] Determining textHeight and textWidth 
when 
> > htmlText
> > > contains images...
> > > 
> > > 
> > > 
> > > I'm trying to build a text component that will dynamically 
size its
> > > height based on the textHeight property after its htmlText 
> > property is
> > > set. However, it appears that the textHeight property doesn't 
> > include
> > > the height of images loaded into the component. e.g. comparing 
the
> > > textHeight of components displaying a string of HTML--one with 
an
> > > image and the other without--yields the same values...
> > > 
> > > Anyone know how to reliable guage how large the content of a 
text
> > > component is when using htmlText with images?
> > > Thanks!
> > > --James
> > >
> >
>


Reply via email to