# Input text Font color

**URL:** <https://forum.kirupa.com/t/input-text-font-color/327906>\
**Category:** flash\
**Created:** [April 4, 2012, 7:55pm UTC](https://forum.kirupa.com/t/input-text-font-color/327906 "2012-04-04T19:55:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![revo999](https://avatars.discourse-cdn.com/v4/letter/r/cab0a1/32.png) [@revo999](https://forum.kirupa.com/u/revo999)\
**Post date:** [April 4, 2012, 7:55pm UTC](https://forum.kirupa.com/t/input-text-font-color/327906/1 "2012-04-04T19:55:13Z")

</div>

I am adding INPUTTEXT through actionscript

and want to change the text color through color picker component

```auto

var mainContainer:MovieClip = new MovieClip();
var fontsContainer:MovieClip;
fontColorPicker.addEventListener(ColorPickerEvent.CHANGE, changeFontColor);
 
function addTextonStage(event:MouseEvent):void
{
    var txtField:TextField = new TextField();
    txtField.type = TextFieldType.INPUT;
    
    txtField.defaultTextFormat = fmt;
    fmt.align = TextFormatAlign.LEFT;
    txtField.multiline = true;
    txtField.autoSize = TextFieldAutoSize.LEFT;
    txtField.antiAliasType = AntiAliasType.ADVANCED;
    txtField.wordWrap = true;
   
    fontsContainer = new MovieClip();
    fontsContainer.addChild(txtField);
    mainContainer.addChild(fontsContainer);
    fontsContainer.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);
    
     
}
 
function changeFontColor(e:ColorPickerEvent):void  
{  
    fmt.color = fontColorPicker.selectedColor; 
    fontsContainer.txtField.defaultTextFormat = fmt;
    fontsContainer.txtField.setTextFormat(fmt);  
       
} 

```

I am not able to get Font color change

**ERRORS:**

```auto
TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at scrapBook_fla::MainTimeline/changeFontColor()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at fl.controls::ColorPicker/onSwatchClick()

```

Following the tutorial , which changing color of inputtext on stage instance

[http://active.tutsplus.com/tutorials/actionscript/develop-a-useful-fon](http://active.tutsplus.com/tutorials/actionscript/develop-a-useful-fon) t-picker-application-with-actionscript-30/
