• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Multiple Choice

The file (“04_multiple_choice.fla”) is a great example of a dynamic multiple-choice quiz. You just assign the variables question, answer1, answer2, answer3, and correctNum, and the text is displayed onscreen. This code could be expanded to load questions from a server or a text file. You can have a lot of questions and even report the score at the end of a quiz. If only it worked! It’s a shame it doesn’t because we even have a highlight for the button that the user clicks, and a way to color the Dynamic Text field for feedback using the new TextFormat object. The only problem is that any answer is considered correct. Here’s a free hint: Salem is the capital of Oregon. Please fix my quiz.

Hint

The entire problem is one missing character that should be included somewhere in the attempt() function. Okay, the problem is found in the if statement’s condition.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint