TextArea change事件,当用数据绑定,或使用AS语言改变TextArea内容时,此事件不发生
如需监听TextArea内容改变,可改用监听textChanged事件
package com.duoduo.lastday.view.ui.chat
{
import flash.events.*;
import mx.controls.TextArea;
public class ChatMess extends TextArea
{
public function ChatMess()
{
super();
this.verticalScrollPolicy="off";
this.addEventListener("textChanged", changeHeight);
this.setStyle("borderStyle", "none");
}
private function changeHeight(event:Event):void
{
trace("text改变");
trace("abc");
this.height=this.textHeight;
trace("th:" + this.textHeight);
this.validateNow();
trace("h:" + this.height);
}
}
}