# Quiz gotoFrame correct answer..problem

**URL:** <https://forum.kirupa.com/t/quiz-gotoframe-correct-answer-problem/289158>\
**Category:** flash\
**Created:** [May 27, 2009, 2:01am UTC](https://forum.kirupa.com/t/quiz-gotoframe-correct-answer-problem/289158 "2009-05-27T02:01:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flashman2](https://avatars.discourse-cdn.com/v4/letter/f/0ea827/32.png) [@flashman2](https://forum.kirupa.com/u/flashman2)\
**Post date:** [May 27, 2009, 2:01am UTC](https://forum.kirupa.com/t/quiz-gotoframe-correct-answer-problem/289158/1 "2009-05-27T02:01:03Z")

</div>

hello i have a simple quiz question,i just can’t quite seem to get right.

i have been learning AS2.0 through modifying scripts to get a better understanding ,here’s the some what original script

this.stop();

mcSubmit.onRelease = function():Void {  
calculateScore();  
};

\_global.style.setStyle(“color”, “white”);  
\_global.style.setStyle(“themeColor”, “red”);  
\_global.style.setStyle(“fontSize”, “14”);  
\_global.style.setStyle(“fontFamily”,“Arial”);  
\_global.style.setStyle(“fontWeight”,“bold”);

function calculateScore():Void {  
var bScoreOne:Boolean = (kindofdog.selectedData == “cat”);  
var bScoreTwo:Boolean = (trained.selectedData == “No sir”);  
var bScoreThree:Boolean = (playset.selectedData == “three”);  
var fScore:Number = 0;  
if(bScoreOne) {  
fScore++;  
}  
if(bScoreTwo) {  
fScore++;  
}  
if(bScoreThree) {  
fScore++;  
}  
this.nextFrame();  
tQuizScore.text = “You scored " + fScore + " correct out of 3 questions.”;  
}

/////////// END /////////

which is fine…BUT how do i tell the script to goto different frames depending on the value (how many question you got right)  
shouldn’t it read it read after the last line

/// BUT if you get " 3 out of 3 " questions correct goto frame 20 //////

```
        if (nScore:Number = 3 
tQuizScore.text = "You scored " + fScore + " correct out of 3 questions.":
        GotoFrame 20();

```

what am i not understanding that this is wrong???

any help would be great thanx
