1. Computing & Technology

Discuss in my forum

Flash Halloween Trivia Quiz

By , About.com Guide

9 of 10

Checking The Score Value
Flash Halloween Trivia Quiz
The last frame is the one where, after the last question, we have to pause to determine where to go next. We need to check the value of score against what’s considered a passing or a failing score. Let’s start off with what will happen if the user clicks on one of the wrong answers:

on (release) {
if (score>4=) {
gotoAndPlay(9) ;
}
if (score<=3) {
gotoAndPlay(10) ;
}
}

Because I have seven questions, the minimum majority to gain a passing score is 4, while anything less would fail. So I set my first if statement to test and see if the value of score is greater than or equal to 4; if so, it should go to and play frame 9, where my “pass” message is displayed.

To make sure all the bases are covered, another if statement tests to see if score is less than or equal to 3, which is the maximum failing score. If so, then the movie goes to frame 10, where my “you fail” message is displayed.

Now let’s make a tiny adjustment to the script for the last right answer.

©2012 About.com. All rights reserved.

A part of The New York Times Company.