Tell User if they Spell Correctly

Does anyone know of a way to give a user feedback on how many letters
they have entered correctly in a spelling type of game. I have a phrase that needs to be re-spelled correctly in text input fields, that the user clicks into and types into.

I have a basic script that evaluates whether the letter entered in an input field is correct, however I want to create it so that it can return the current number of correct letters. How might I write the AS for such a thing without creating tons of separate statements and Dynamic Text Variables.

Here is a snippet of my code, as you can see the dynamic text variable “answer” is addressing only one letter. How can I make it do double duty and be aware of how many letters are correct?


stop();

letrA = inputA
if (letrA == "A")	{
	_root.letterA.gotoAndPlay(2);
	answer = "Letter A is Correct!"  ;
} else {
	answer = "Wrong"   ;
}

It could return a statement like, “You have 2 of the correct letters” or “The letters A, R, and T are correct!”