Constructing the Responses


Now that we have a Question and four possible Answers, we need to formulate a few Responses: Lose and Win.

Lose State

The Lose frame replaces the question on the Q layer with the message "Sorry, wrong" (Figure 1.9). The keyframe has a single line of ActionScript ”just

Figure 1.9. The Lose Screen

graphics/01fig09.jpg

ActionScript
 stop(); 

This has the desired effect of keeping the player at this screen until he decides to move on. It is a trivial interaction; the player has no other choice and in fact is not penalized for making a bad choice ”yet.

The Lose frame drops layers a1, a2, and a3 (three buttons ) and changes the text on the remaining button. More important, it also changes the button's Object Actions script. The new Object Action script has a goTo aimed at the Start frame (Figure 1.10).

Figure 1.10. Programming the Try Again Button

graphics/01fig10.gif

Win State

Finally, the Win frame tells the player he won the round and presents a little explanatory text (Figure 1.11).

Figure 1.11. The Win Screen

graphics/01fig11.jpg

We have all the parts of a very primitive quiz round. Try it (C ONTROL /T EST M OVIE ). It moves ”but it feels dead. So far there is no scorekeeping, just the display of text. In fact, the player who gets here after three wrong guesses gets pretty much the same payoff as the player who knows the correct answer right away.



Flash and XML[c] A Developer[ap]s Guide
Flash and XML[c] A Developer[ap]s Guide
ISBN: 201729202
EAN: N/A
Year: 2005
Pages: 160

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net