How do automatically adjust the textarea's height in flex when I give it some default value

When the parent component is loaded, I give textarea a default value, and I want to the textarea automatically adjust it's height with the value. The code is followed:

protected function commentContentGroup_creationCompleteHandler(event:FlexEvent):void { // TODO Auto-generated method stub userCommentContent.addEventListener(KeyboardEvent.KEY_DOWN, sendInfor); scrollerContentHieght=20; commentContentGroupHeight=this.height; userCommentContent.addEventListener(TextEvent.TEXT_INPUT, userCommentContent_textInputHandler); userCommentContent.addEventListener(TextOperationEvent.CHANGE, userCommentContent_changeHandler); // userCommentContent.addEventListener(TextEvent.TEXT_INPUT,userCommentContent_changeHandler); this.userCommentContent.text = "The Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget"; }

I think the CHANGE event is not triggered.

-------------Problems Reply------------

If you want to assign height every time the component is displayed (added to display list) then you can use Event.ADDED_TO_STAGE. If you want it only once then creation complete should be sufficient. If you need more help please paste your complete code.

Category:flex Views:3 Time:2016-03-16

Related post

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.076 (s). 11 q(s)