Simple quiz score
Hi,
I've searched the forums and found lots of answers that are for much more complicated questions then this one. I can't find quite the answer I need.
Basically I have a series of images with four possible answers below them as buttons. Only one of those answers is correct.
If the user clicks on the correct button I need 1 added to the total score.
So I've created a dynamic text box (which is nested two movie clips down) and I've called that "quizresult_text"
So that is nested like this: gallery_items.quizscore_mc.quiz.result_text
I've set up a variable as you'll see in this example button.
var score:int = 0;
btn1.addEventListener(MouseEvent.CLICK, Add1);
function Add1(e:MouseEvent):void {
score = score+1;
gallery_items.quizscore_mc.quizresult_text = "" +score.toString();
}
It's not working and I'm getting this error message:
TypeError: Error #1034: Type Coercion failed: cannot convert "1" to flash.text.TextField.
at Feb1BBB_fla::MainTimeline/Add1()[Feb1BBB_fla.MainTimeline::frame1:9]
Any advice appreciated.
