Thanks for the reply but its still not working for me. Actually i tried the same u did for my TextArea component but this time the height takes the full screen.
<?xml version="1.0" encoding="utf-8"?> <mx:TextArea xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="initComponent()"> <mx:Script> <![CDATA[ private function initComponent() : void { this.height = this.textHeight; }// ]]> </mx:Script> </mx:TextArea> And i used this in my application using lengthy text. But somehow this time the height takes the full screen. My requirement is to adjust the height of the textarea so that the text exactly fits into it. --- In flexcoders@yahoogroups.com, "Tracy Spratt" <[EMAIL PROTECTED]> wrote: > > I extended Text like this: > > <?xml version="1.0" encoding="utf-8"?> > > <mx:Text xmlns:mx="http://www.adobe.com/2006/mxml" > > creationComplete="initComponent()"> > > <mx:Script><![CDATA[ > > > > private function initComponent():void > > { > > this.height = this.textHeight; > > }// > > ]]></mx:Script> > > > > </mx:Text> > > > > Seemed to work for my situation. Of course, "this.height = > this.textHeight;" is the core. > > > > Tracy > > > > ________________________________ > > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On > Behalf Of prashant194 > Sent: Monday, July 14, 2008 1:00 PM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] textarea with auto height > > > > Hello all, > > I want to have my textarea auto resize its height based on the length > of the text it contains. The width of the text area remains fixed. How > can i do that? >