# TextArea formatting

**URL:** <https://forum.kirupa.com/t/textarea-formatting/268529>\
**Category:** flash\
**Created:** [August 14, 2008, 11:20pm UTC](https://forum.kirupa.com/t/textarea-formatting/268529 "2008-08-14T23:20:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![PCPete](https://avatars.discourse-cdn.com/v4/letter/p/f05b48/32.png) [@PCPete](https://forum.kirupa.com/u/PCPete)\
**Post date:** [August 14, 2008, 11:20pm UTC](https://forum.kirupa.com/t/textarea-formatting/268529/1 "2008-08-14T23:20:50Z")

</div>

Apologies if this has been answered but my best attempts at googling have failed me, as have my books, adobe documentation, and a forum search! So again, sorry if this has been answered in detail.

Basically, I have a TextArea component with an instance name of inputText to start. I have 2 colorpickers on my stage, one will control the inputText font color, the other will control the inputText background color. At least, those are my hopes.

So to start, I wanted to just get my color picker’s change event to change all the text in TextArea to what was selected. I have 5 frames, the first frame will be my preloader (will be preloading a giant list of fonts later) and on frame 5 the following code appears:

```auto

stop();

import fl.controls.ColorPicker;
import fl.events.ColorPickerEvent;
fontColor.addEventListener(ColorPickerEvent.CHANGE,changeFontColor);

function changeFontColor(event:ColorPickerEvent):void {
    var myCP:ColorPicker = event.currentTarget as ColorPicker;
    var format:TextFormat = new TextFormat();
    var ta:TextFormat = new TextFormat();
    ta.color = "0x"+myCP.hexValue;
    inputText.setTextFormat(ta);
}

```

I get no errors when I check it, however, when I run the movie I get the following error: “1061: Call to a possibly undefined method setTextFormat through a reference with static type fl.controls:TextArea.”

What am I doing wrong? I’ve struggled with this problem for a full day now, so I’m turning to you for what I’m sure is an easy explanation as I learn AC3.

thanks!
