# Adding stylesheet to TextArea

**URL:** <https://forum.kirupa.com/t/adding-stylesheet-to-textarea/271033>\
**Category:** Uncategorized\
**Created:** [September 17, 2008, 4:41pm UTC](https://forum.kirupa.com/t/adding-stylesheet-to-textarea/271033 "2008-09-17T16:41:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![uberalles](https://avatars.discourse-cdn.com/v4/letter/u/e47774/32.png) [@uberalles](https://forum.kirupa.com/u/uberalles)\
**Post date:** [September 17, 2008, 4:41pm UTC](https://forum.kirupa.com/t/adding-stylesheet-to-textarea/271033/1 "2008-09-17T16:41:53Z")

</div>

Pretty simple question here:  
How can I add a stylesheet to a TextArea?

I’ve tried it with two scenarios. One where I had drawn the TextArea right on the stage and another when I added the TextArea using AS.

Using this code:

```auto

var chatarea:TextArea = new TextArea();
chatarea.x = 156.3;
chatarea.y = 12.4;
chatarea.width = 725.9;
chatarea.height = 316.0;
var style:StyleSheet = new StyleSheet();
style.setStyle("html", {fontFamily:"Arial,Helvetica,sans-serif", fontSize:"12px", color:"#0000FF"});
style.setStyle("body", {color:"#00CCFF", textDecoration:"underline"});
chatarea.styleSheet = style;

```

I get the following error:

```auto

1119: Access of possibly undefined property styleSheet through a reference with static type fl.controls:TextArea.ea 

```

Can anyone shed some light on what’s wrong here and how I can add a simple stylesheet to a TextArea?  
Thanks in advance.
