I have been having an issue with setting htmlText with img tags embeded. Usually the first time you set the htmlText of a text field it is ok, but when you set it again you get an error:
The supplied DisplayObject must be a child of the caller
There was no elegant solution to this so I have created one. Here it is…
package ****{
import mx.core.mx_internal;
use namespace mx_internal;
import mx.controls.TextArea;
public class FixedTextArea extends TextArea{
public function FixedTextArea(){
super();
}
override public function set htmlText(value:String):void{
mx_internal::removeTextField();
mx_internal::createTextField(-1);
super.htmlText = value;
}
}
}
It’s never been easy to download movies.
This TextArea fix is amazing! However, I want to the TextArea editable=false as well.
After inserting the code mentioned above, the editable=false is having no effect.
Kindly let me know how this can be done.
Thanks!
Found a solutions. For the textArea, I added this:
textInput=”event.preventDefault()”
This works fine.
Hi, how can I use this class?
I’ve already created and imported into my stage but should I create a new FixedTextArea() or my current textarea will inherits the method?
Thanks