# Input text quiz actionscript problem/question

**URL:** https://forum.kirupa.com/t/input-text-quiz-actionscript-problem-question/58554
**Category:** Uncategorized
**Created:** [July 23, 2004, 2:17pm UTC](https://forum.kirupa.com/t/input-text-quiz-actionscript-problem-question/58554 "2004-07-23T14:17:54Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sujo](https://avatars.discourse-cdn.com/v4/letter/s/e56c9b/32.png) [@sujo](https://forum.kirupa.com/u/sujo)
#### Post date: [July 23, 2004, 2:17pm UTC](https://forum.kirupa.com/t/input-text-quiz-actionscript-problem-question/58554/1 "2004-07-23T14:17:54Z")

</div>

I am working on a quiz with input text boxes. the user will enter a letter into the input box, then click a button to check answers. If the answer is correct, the text should turn green. If wrong the text should turn red and give feedback to try again for the red letters. I have started the page and the actionscript on the check answers button, but I don’t know if I am even moving in the right direction. Please help me!

---

<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: [July 26, 2004, 7:41am UTC](https://forum.kirupa.com/t/input-text-quiz-actionscript-problem-question/58554/2 "2004-07-26T07:41:02Z")

</div>

I can’t open your attachment…but I’ll do my best.

Let’s say your Input Text has an instance name of “tfield” and a Var as "input"  
Put this code on a button:

```php
 
on (release) {
	 if (_root.input == "dog") {
		 format = new TextFormat();
		 format.color = 0x006600;
		 tfield.setTextFormat(format);
	} else {
		 format = new TextFormat();
		 format.color = 0xFF0000;
		 tfield.setTextFormat(format);
	}
}

```

Here’s a site about formating text fields:  
[http://www.kirupa.com/developer/actionscript/textfield.htm](http://www.kirupa.com/developer/actionscript/textfield.htm)

hope it helps 🙂
