
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
34
|
Chapter 1: A Gentle Introduction for Nonprogrammers
Building the Quiz End
Our quiz is nearly complete. We have two questions and an answer-tracking script
that lets the user answer the questions and progress through the quiz. We still need a
quiz-ending screen where we score the quiz and tell the user how well he fared.
To build our quiz-end screen, we need to do some basic Flash production and some
scripting. Let’s do the production first:
1. At frame 20 of the question 2 layer, add a blank keyframe. This prevents Ques-
tion 2 from appearing behind the contents of our quiz-end screen.
2. At frame 20 of the choice buttons layer, add a blank keyframe. This prevents our
buttons from appearing behind the contents of our quiz-end screen.
3. At frame 20 of the quiz end layer, add a blank keyframe.
4. While you’re still on that frame, put the following text on the Stage: “Thank you
for taking the quiz.” Make sure to leave some space below for the user’s score.
5. At frame 20 of the scripts layer, add a blank keyframe.
That takes care of the production work for our quiz-end screen. Your end screen
should look something like the one shown in Figure 1-9.
Now let’s work on the quiz-end script. When the playhead lands on our
quizEnd
frame, we want to calculate the user’s score. We need a calculation ...