# TextField.color

**URL:** <https://forum.kirupa.com/t/textfield-color/65118>\
**Category:** flash\
**Created:** [September 23, 2004, 4:33am UTC](https://forum.kirupa.com/t/textfield-color/65118 "2004-09-23T04:33:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashishchandras](https://avatars.discourse-cdn.com/v4/letter/a/7993a0/32.png) [@ashishchandras](https://forum.kirupa.com/u/ashishchandras)\
**Post date:** [September 23, 2004, 4:33am UTC](https://forum.kirupa.com/t/textfield-color/65118/1 "2004-09-23T04:33:20Z")

</div>

Hi,

I have problem assigning color to a dynamic textfield using TextFormat Object. Does anybody knows??

## This example i got from Flash Help but this also doesnt work:

The following example creates a text field and sets the text color to red.

var my\_fmt:TextFormat = new TextFormat();  
my\_fmt.blockIndent = 20;

## this.createTextField(“my\_txt”, 1, 100, 100, 300, 100); my\_txt.multiline = true; my\_txt.wordWrap = true; my\_txt.textColor = “#C6032A” // this is what i worte but not working either my\_txt.border = true; my\_txt.text = “this is my first test field object text”; my\_txt.setTextFormat(my\_fmt);

* * *

aShIsH

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 23, 2004, 4:51am UTC](https://forum.kirupa.com/t/textfield-color/65118/2 "2004-09-23T04:51:01Z")

</div>

I’m not sure if this will work, but try it anyway:[AS]my\_txt.textColor = 0x003468[/AS]Again, I don’t know if it will work.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 23, 2004, 5:09am UTC](https://forum.kirupa.com/t/textfield-color/65118/3 "2004-09-23T05:09:21Z")

</div>

> [@wizard](#):
>
> I’m not sure if this will work, but try it anyway:[AS]my\_txt.textColor = 0x003468[/AS]Again, I don’t know if it will work.

Hi Dear,

If u look at the code i pasted above u will find what i have tried.  
mytext.textColor = “#C6032A”;

but its not working. Any one else pls !!

* * *

aShIsh

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 23, 2004, 5:13am UTC](https://forum.kirupa.com/t/textfield-color/65118/4 "2004-09-23T05:13:40Z")

</div>

So I guess the code I gave you didn’t work?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 23, 2004, 5:21am UTC](https://forum.kirupa.com/t/textfield-color/65118/5 "2004-09-23T05:21:19Z")

</div>

Wait I just tried it and it did work…[AS]var my\_fmt:TextFormat = new TextFormat();  
my\_fmt.blockIndent = 20;  
this.createTextField(“my\_txt”, 1, 100, 100, 300, 100);  
my\_txt.multiline = true;  
my\_txt.wordWrap = true;  
my\_txt.textColor = “0xC6032A”;  
my\_txt.border = true;  
my\_txt.text = “this is my first test field object text”;  
my\_txt.setTextFormat(my\_fmt);  
[/AS]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 23, 2004, 5:26am UTC](https://forum.kirupa.com/t/textfield-color/65118/6 "2004-09-23T05:26:40Z")

</div>

> [@wizard](#):
>
> Wait I just tried it and it did work…[AS]var my\_fmt:TextFormat = new TextFormat();  
> my\_fmt.blockIndent = 20;  
> this.createTextField(“my\_txt”, 1, 100, 100, 300, 100);  
> my\_txt.multiline = true;  
> my\_txt.wordWrap = true;  
> my\_txt.textColor = “0x003468”;  
> my\_txt.border = true;  
> my\_txt.text = “this is my first test field object text”;  
> my\_txt.setTextFormat(my\_fmt);  
> [/AS]

Hi,

Its working here as well. 🐇  
Thanx…alot

* * *

aShIsH

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 23, 2004, 5:27am UTC](https://forum.kirupa.com/t/textfield-color/65118/7 "2004-09-23T05:27:41Z")

</div>

You’re welcome. :}
