# TextFormat disappears

**URL:** https://forum.kirupa.com/t/textformat-disappears/287038
**Category:** Uncategorized
**Created:** [April 24, 2009, 9:57pm UTC](https://forum.kirupa.com/t/textformat-disappears/287038 "2009-04-24T21:57:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![tykebloke](https://avatars.discourse-cdn.com/v4/letter/t/f4b2a3/32.png) [@tykebloke](https://forum.kirupa.com/u/tykebloke)
#### Post date: [April 24, 2009, 9:57pm UTC](https://forum.kirupa.com/t/textformat-disappears/287038/1 "2009-04-24T21:57:52Z")

</div>

…when i set the textField with new text eg:

var tf = new TextField();  
var myFormat = new TextFormat();

//set textField format  
myFormat.color = 0xffffff;  
tf.setTextFormat(myFormat);  
addChild(tf)

//this will remove the text format.  
tf.text = “some text”;

* * *

Any help appreciated.

Do i have to set the text format again every time it changes? If so, which event do i listen for? ie tf.addEventListener(TextEvent.CHANGE, setFormat).

thanks
