check out the component
Average rating
Blogged with the Flock Browser
Adobe Flex is a software development kit released by Adobe Systems for the development and deployment of cross-platform rich Internet applications based on the Adobe Flash platform. Flex applications can be written using Adobe Flex Builder or by using the freely available Flex compiler from Adobe.
UPDATE: turns out that doesn’t always work. the autoSize property is not reliable at all…
This, should do!
var ta_height:uint = 25;
field.validateNow();
for(var i:int=0; i < field .mx_internal::getTextField().numLines; i++) {
ta_height += field.mx_internal::getTextField().getLineMetrics(i).height;
}
derivedHeight = ta_height;
Thanks Vaan.
Original post:
Adobe’s dodgy textHeight sure doesn’t do the trick. I end up getting a textfield of 2000px height while it clearly looks like 300 tops.
This, however, works.
the code
private function resizeMe(field:TextArea) :void
{
field.validateNow();
field.mx_internal::getTextField().autoSize = TextFieldAutoSize.LEFT;
field.height = field.mx_internal::getTextField().height;
}
Just use that on your TextArea or Text component:
creationComplete="resizeMe(this.myTextAreaInstance)"