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.
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