# Quiz on Flash Basics

**URL:** <https://forum.kirupa.com/t/quiz-on-flash-basics/323078>\
**Category:** flash\
**Created:** [June 14, 2011, 3:07am UTC](https://forum.kirupa.com/t/quiz-on-flash-basics/323078 "2011-06-14T03:07:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![FlashAj325](https://avatars.discourse-cdn.com/v4/letter/f/5daacb/32.png) [@FlashAj325](https://forum.kirupa.com/u/FlashAj325)\
**Post date:** [June 14, 2011, 3:07am UTC](https://forum.kirupa.com/t/quiz-on-flash-basics/323078/1 "2011-06-14T03:07:50Z")

</div>

[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]

```auto

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]

```auto

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
