# TextInput text color pain

**URL:** https://forum.kirupa.com/t/textinput-text-color-pain/315305
**Category:** flash
**Created:** [October 22, 2010, 3:05pm UTC](https://forum.kirupa.com/t/textinput-text-color-pain/315305 "2010-10-22T15:05:12Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![abrandao](https://avatars.discourse-cdn.com/v4/letter/a/bc79bd/32.png) [@abrandao](https://forum.kirupa.com/u/abrandao)
#### Post date: [October 22, 2010, 3:05pm UTC](https://forum.kirupa.com/t/textinput-text-color-pain/315305/1 "2010-10-22T15:05:12Z")

</div>

Hey guys I’m having trouble setting the color of the text of a TextInput component.

I know there is a TextField within it, I’m trying several methods, but none works:

----------- method 1 (textField.textColor)

\_input\_name = new TextInput();  
\_input\_name.textField.background = true;  
\_input\_name.textField.backgroundColor = 0x2a2a2a;  
\_input\_name.textField.textColor = 0xFFFFFF;  
\_input\_name.text = “some text”;

addChild(\_input\_name);

----------- method 2 (textField.defaultTextFormat)

var tfm:TextFormat = new TextFormat();  
tfm.color = 0xFFFFFF;

\_input\_name = new TextInput();  
\_input\_name.textField.background = true;  
\_input\_name.textField.backgroundColor = 0x2a2a2a;  
\_input\_name.textField.borderColor = 0xCCCCCC;  
\_input\_name.text = “some text”;  
\_input\_name.textField.defaultTextFormat = tfm;

addChild(\_input\_name);

* * *

background color changes nicely but text won’t react 😕
