In this chapter, we do not attempt to conscientiously teach Flash graphics creation. That is the subject of many other books. The chapter is not even an overview of the subject. In fact this chapter is more of an underview. We offer a mouse's-eye view of the construction of a few simple but sophisticated interface elements. We don't suggest that our methods are the best approach to each problem. Multifaceted software like Flash invites creative approaches. The approach we show here, based on much experience in team production of code and graphics, is one good approach. Consider it as you develop your own.
The trivia quiz game that we will build throughout this book is complex and sophisticated. It starts, however, with some simple ideas that are recognizable in every later step of development.
Before we start any code, even demonstration code, we need to think a little about the design. In general, a detailed planning phase is always a good investment. But in this case, just a simple layout of hierarchy will suffice.
We organize a Game into a series of Quizzes (Figure 1.1). Each Quiz has several rounds. A Round is the presentation of a Question, the player's response, and the scoring. The Question is presented in Q&A format: a single Q and multiple-choice A 's.
Figure 1.1. Object Hierarchy of the Trivia Game
In this chapter we create a single functional Round. We present a Question and a series of Answer options and determine whether the player has chosen the correct one. That's all for now.
Our approach is to develop three states : Start state, Win state, and Lose state (Figure 1.2). The latter two states comprise the Response to the user . The Start state encapsulates the Question presentation.
Figure 1.2. Logic at One Round