Evaluating the Guess
Set the label to "Calcguess" Add a new keyframe and label it "EvalGuess", here we will evaluate the users guess by going through the following actions:
If (/:hmGuess <%gt%> /:Num) Set Variable: "fback" = "Too High" End If If (/:hmGuess <%lt%> /:Num) Set Variable: "fback" = "Too Low" End If If (/:hmGuess = /:Num) Set Variable: "fback" = "" Set Variable: "correct" = /:Num Go to and Stop ("quit") End If
The Quit frame will be made later and jumped to when the guess is correct, also displaying the correct number by showing the "correct" variable. As you might have guessed: hmGuess holds the players guess.
Insert a new layer, name it "Menu", as it will hold the two user-choice buttons, and a Stop option.
|» Level Advanced|
Rating: 5.98 Votes: 503
|Peter is a twisted former teacher of English, who now only obeys the grammer of actionscript. He loves writing educational Flash pieces, and is known to enjoy reading actionscript poems by other authors as well.|
|Download the files used in this tutorial.|
|Download (11 kb)|
|More help? Search our boards for quick answers!|