You'll have to make a custom measure function that sets the width of the TextArea before measuring. Wordwrapping text can be any size and you have to fix the width to get the height.. Look at ListItemRenderer for an example of fixing the width of its internal TextField.
________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Manish Jethani Sent: Friday, February 01, 2008 5:22 AM To: [email protected] Subject: Re: [flexcomponents] autoresize text area as a itemrenderer On 2/1/08, learner <[EMAIL PROTECTED] <mailto:peacocksea%40gmail.com> > wrote: > I want to have my list variable row height ...precisely the height of the row should the height of the text displayed in it.. > > I have my item rendere like this ..it has image to show and textArea which will have html text to display in it... [snip] > messageTxt = new TextArea(); > override protected function measure():void{ > trace("measure for message box " + msgObject.message) > super.measure(); > messageTxt.x = 55; > messageTxt.width = this.width - 55 - timeStamp.width; > // should i set the height of the messageTxt here as messageTxt.height = messageTxt.textHeight ............but it does not work correctly.. > } Try calling messageTxt.validateNow() before accessing the height. The TextArea object needs to remeasure its height based on the width you've set. Manish
