On 9/16/05, xiankevin2005 <[EMAIL PROTECTED]> wrote:
> is it possible?how to make the Text control editable or to make the
> TextArea control adjust its height to fit the content?
The TextArea by default does not adjust its height. Every component
measures its width and height during layout -- the TextArea sets its
preferred height to 44 px.
So you can extend the TextArea, override measure, and set the
_measuredPreferredHeight in there.
import mx.controls.TextArea;
class MyTextArea extends TextArea
{
public function measure():Void
{
super.measure();
_measuredPreferredHeight = label.textHeight + 4;
}
function keyDown(e:Object):Void
{
super.keyDown(e);
invalidateSize();
}
}
Now you can use MyTextArea in your application.
------------------------ Yahoo! Groups Sponsor --------------------~-->
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~->
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/