Google


   


You are here: CodeIdol.com > Flash > Flash and XML: A Developer's Guide > Flash > Constructing The Responses

SAVE
Digg
Shown on del.icio.us del.icio.us
See Whos Talking About This on Technorati Technorati
I've Reddit reddit

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 (CONTROL/TEST MOVIE). 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.

    SAVE
    Digg
    Shown on del.icio.us del.icio.us
    See Whos Talking About This on Technorati Technorati
    I've Reddit reddit

    You are here: CodeIdol.com > Flash > Flash and XML: A Developer's Guide > Flash > Constructing The Responses


    ADBRITE ads links
       
    Related tags







    Popular Categories
    Unix books and guides

    AJAX popular information
    C# language guides
    Windows books and cookbooks

    .......








    Business Key Top Sites

    be number one
    rate your site





    © CodeIdol Labs, 2007 - 2009