In Flash AS3, while using TextArea Component in the following way:
import fl.controls.TextArea; var myTxt:TextArea = new TextArea(); //define position on stage myTxt.move(50,50); //define size of TextArea myTxt.setSize(300, 50); myTxt.htmlText = "<li>Lorem ipsum dolor</li> <li> sit amet, consectetuer adipiscing elit.</li> <li>Vivamus quis nisl vel tortor nonummy vulputate.</li> <li> Quisque sit amet eros sed purus euismod tempor. Morbi tempor.</li> <li>Curabitur diam. </li> <li> Morbi tempor</li> "; //display it on stage addChild(myTxt);
But despite importing fl.controls.TextArea, you might still get the following error:
1172: Definition fl.controls:TextArea could not be found.
It’s solution is quite simple, whenever using Components inside Flash from Components Panel, always drag them once onto the stage, you can delete the dragged instance afterwards. This way, they are automatically added to the library.
Removing blue border around TextArea component
By default, selecting the text area shows a blue border around it. You can easily reset by applying a non-existing skin name “noSkin” to the “focusRectSkin” and “upSkin” states like this:
myTxt.setStyle("focusRectSkin",noSkin); myTxt.setStyle("upSkin",noSkin);
Hoep that helps.
Cheers!