I was struggling with this as well. Dmitri offered a great solution,
but my final solution was much less complicated. I added this funtion
to my .mxml file (which I got from
http://weblogs.macromedia.com/nwatson/archives/2005/09/index.cfm):
private function updateHeight(target:Object):void
{
target.height = target.textHeight + 5;
}
and I here is the TextArea tag:
<mx:TextArea id="txtQuestion" htmlText="{currentQuestionSet.QUESTION}"
width="100%" updateComplete="updateHeight(event.target)"
fontWeight="bold" wordWrap="true" editable="false" borderThickness="0"
verticalScrollPolicy="off" />
Now, my TextArea was not in a repeater, but it works beautifully for
my app. The big problem I had was finding the right event to run the
function off of (in other words, updateComplete may not be the right
event for you).
Good luck,
Matt Davis
--- In [email protected], "Dmitri Girski" <[EMAIL PROTECTED]> wrote:
>
> By a coincidence I created yesterday a component you are talking about.
>
> http://mitek.id.au/flex/ElasticTextField.as
>
> The important thing is - it works in Flex "Printing Plant/Engine".
>
> PS This is a readonly thing as my primary goal was printing. I tried
> to use TextArea - it does not work in printing, for some reason it
> does not know how to measure the textHeight/Width. TextField works
> fine though.
>
> Cheers,
> Dmitri.
>
>
> --- In [email protected], grimmwerks <grimm@> wrote:
> >
> > I'm using a Repeater to loop through chunks of text and toss them
in a
> > VBox. Trouble is all the text boxes are the same = there doesn't
seem
> > to be a way to set a box to it's own internal text size? I'd like
the
> > boxes to be all different heights, just enough to view the text.
> >
> > Help?
> >
>