# onChanged text color

**URL:** <https://forum.kirupa.com/t/onchanged-text-color/175660>\
**Category:** flash\
**Created:** [January 16, 2006, 9:09pm UTC](https://forum.kirupa.com/t/onchanged-text-color/175660 "2006-01-16T21:09:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![oldgreymare](https://avatars.discourse-cdn.com/v4/letter/o/838e76/32.png) [@oldgreymare](https://forum.kirupa.com/u/oldgreymare)\
**Post date:** [January 16, 2006, 9:09pm UTC](https://forum.kirupa.com/t/onchanged-text-color/175660/1 "2006-01-16T21:09:38Z")

</div>

Hi there

I’m making a little quiz for kids to learn how to estimate percent from a pie chart. If they estimate too little or too much I want the text to change colour, but I can’t get it to work.  
I have two text fields, one input, one dynamic. They both have the same variable name so that when you type into the input it automatically fills the dynamic. I want the dynamic text field to change colour. I’ve attached the code for a simple version with only one pie chart on the page. The code for it is below.

```auto
correctDiscount=25;

estimate1.onSetFocus = function(oldFocus) {
this.text = "";
}	

estimate1.onChanged = function() {
if(estimate1==correctDiscount){
	trace("correct");
	discount1.textColor = 0x990000;
} else {discount1.textColor = 0x00ff00;
	trace("incorrect");
}
}

```

It traces nothing and all text is green (00ff00).  
Any ideas?

ogm
