Quick example, and kinda rough around the edges :)
<mx:Script>
<![CDATA[
private function changed() : void
{
ta.validateNow();
ta.height = Math.max(Math.min(ta.textHeight, 250), 40) + 20;
}
]]>
</mx:Script>
<mx:TextArea width="300" horizontalCenter="0" verticalCenter="0"
change="changed()" id="ta"/>
On Fri, Aug 1, 2008 at 12:39 PM, Alex Harui <[EMAIL PROTECTED]> wrote:
> Normally, I use callLater then set the component's height to its
> measuredHeight. CallLater is required because the player doesn't always
> know the text dimension in the same frame you set the text in.
>
>
> ------------------------------
>
> *From:* [email protected] [mailto:[EMAIL PROTECTED] *On
> Behalf Of *flexawesome
> *Sent:* Thursday, July 31, 2008 7:27 PM
> *To:* [email protected]
> *Subject:* [flexcoders] Re: A simple component in AS - Setting height
> Issues
>
>
>
> Thanks for your replay...that could be make the component more big
> and slow?
>
> I'd love to see how to set the textArea height dynamically after
> setting the text.
>
> Thanks
>
> --- In [email protected] <flexcoders%40yahoogroups.com>, "Josh
> McDonald" <[EMAIL PROTECTED]> wrote:
> >
> > If you set width only on your Text, and put it in a Canvas with no
> height
> > set, it should grow as the Text component grows.
> >
> > On Fri, Aug 1, 2008 at 11:57 AM, flexawesome <[EMAIL PROTECTED]>
> wrote:
> >
> > > Hey I was trying to figure out how to dynamically make the grow in
> > > height with the textArea in my component.
> > >
> > > by checking the docs here
> > >
> http://livedocs.adobe.com/flex/3/langref/mx/controls/TextArea.html#tex
> tH
> > > eight
> > >
> > > I was called the validateNow() method on the line 76, I was tried
> both
> > > height & textHeight. However, it didn't work correctly.
> > >
> > > _txtHolder.setActualSize( unscaledWidth, _txtHolder.height );
> > > _txtHolder.setActualSize( unscaledWidth, _txtHolder.textHeight );
> > >
> > >
> > > code is here:
> > >
> > > http://www.privatepaste.com/c1QXxA5NBO
> > >
> > > Any suggestion
> > >
> > >
> > > ------------------------------------
> > >
> > > --
> > > Flexcoders Mailing List
> > > FAQ:
> http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > > Search Archives:
> > > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo!
> Groups
> > > Links
> > >
> > >
> > >
> > >
> >
> >
> > --
> > "Therefore, send not to know For whom the bell tolls. It tolls for
> thee."
> >
> > :: Josh 'G-Funk' McDonald
> > :: 0437 221 380 :: [EMAIL PROTECTED]
> >
>
>
>
--
"Therefore, send not to know For whom the bell tolls. It tolls for thee."
:: Josh 'G-Funk' McDonald
:: 0437 221 380 :: [EMAIL PROTECTED]