I want to build a textinput that adapts itself from the maxchars value of its textdisplay.
I tried to override the init function of the component like this:
override protected function initializationComplete():void{
if(this.textDisplay.maxChars != 0){
this.maxWidth = this.textDisplay.maxChars*10;
super.initializationComplete();
}
}
But it doesn’t work at all. How can I code this?
Thats already there in s:textinput property named widthInChars
set that value to maxChars value like this
Im mxml
In as
Try this
I hope this might help you.