<p>I create a TextArea in actionscript:</p>

<pre><code>var textArea:TextArea = new TextArea();
</code></pre>

<p>I want it to have a black background.  I've tried</p>

<pre><code>textArea.setStyle("backgroundColor", 0x000000);
</code></pre>

<p>and I've tried</p>

<pre><code>textArea.opaqueBackground = 0x000000;
</code></pre>

<p>but the TextArea stays white.  What should I do?</p>

TextArea is a UI component built from TextField and other Flash built-in classes and UIComponents. As with most of the Adobe UI components, nothing is as it seems when setting properties. To set the color of the area behind the text in the TextArea, you need to actually set the opaque background of its internal TextField using the textField property:
```
```
var textArea:TextArea = new TextArea()
textArea.textField.opaqueBackground = 0x000000;
```
```
Of course now that the background is black, the text can't also be black, so we change its color using a new TextFormat:
```
```
var myFormat:TextFormat = new TextFormat();
myFormat.color = 0xffffff;
textArea.setStyle("textFormat",myFormat);
```
```
then just set the text and add to stage:
```
```
textArea.text = "hello";
addChild(textArea);
```
```
Also, if you want a little more control, there's a nice extension class here that fixes a lot of the problems with TextArea:
http://blog.bodurov.com/Post.aspx?postID=14