1. Home
  2. Computing & Technology
  3. Animation

Flash Halloween Trivia Quiz

By , About.com Guide

9 of 10

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.

Explore Animation
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Animation
  4. Flash Animation Tutorials
  5. Flash Halloween Trivia Quiz

©2009 About.com, a part of The New York Times Company.

All rights reserved.