Nov
30
2010[AS3] Flash AS3 TextArea Component tips
Tags: Flash AS3In 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!
Related posts:
- Using the UIScrollbar component with TextField in Flash AS3 for scrolling text
- [AS3] Using Slider Component to Move through MovieClip Frames in Flash ActionScript 3
- [AS3] Dynamically create border around MovieClips in Flash using ActionScript
- [AS3] Add Dynamic MovieClips to ScrollPane component using Flash
- [AS3] Pre-loading external images using the UILoader Component in Flash ActionScript
Recent Comments
(3 days ago)
(3 days ago)
(1 weeks ago)
(1 weeks ago)
(1 weeks ago)
(1 weeks ago)
(1 weeks ago)
(1 weeks ago)
(2 weeks ago)
(2 weeks ago)