[FONT=Courier New]I have a problem. I made a thirty-question quiz, and after the 2nd/3rd question, the quiz starts skipping questions (frames) by 2’s. I made an array that keeps track of the answers answered correctly and the answers answered incorrectly (1 = correct, 0 = incorrect). Then, I made it so I get a variable that adds all of the values in tahat array together. Then I create a personalized message based on the quiz-taker’s score. I put the following code on its own layer:[/FONT]
var wrongAnswers = new Array();
var questionNumber:uint;
function nextQuestion(event:MouseEvent):void{
gotoAndStop(questionNumber + 4);
//0 for wrong, 1 for right.
wrongAnswers[questionNumber-1] = 1;
trace(wrongAnswers[questionNumber-1]);
}
function wrongAnswer(event:MouseEvent):void{
gotoAndStop(questionNumber + 4);
//0 for wrong, 1 for right.
wrongAnswers[questionNumber-1] = 0;
trace(wrongAnswers[questionNumber-1]);
}
[FONT=Courier New]And the following code on each question’s individual frame:[/FONT]
stop();
questionNumber = 1;
//Insert the correct answer where the * is, and remove the line of code that starts with its letter
b_btn.addEventListener(MouseEvent.CLICK, nextQuestion);
a_btn.addEventListener(MouseEvent.CLICK, wrongAnswer);
//b_btn.addEventListener(MouseEvent.CLICK, wrongAnswer);
c_btn.addEventListener(MouseEvent.CLICK, wrongAnswer);
d_btn.addEventListener(MouseEvent.CLICK, wrongAnswer);
[FONT=Courier New](This is the code for the first question, which is on frame four, and b is the correct letter)[/FONT]
[FONT=Courier New]I doubt I screwed anything up with the answers. I think it might be that I made all the instances of the answer buttons the same (a_btn, b_btn, etc.), and this has given me problems before. Help? Thanks![/FONT]
-FlashAj325