• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Lesson 16. Building a Quiz with Components > Using the ListBox Component

Using the ListBox Component

Though the combo box looked a bit different than the radio buttons, you still had four options, each one comprising a unique label and a unique data value. In this task, you'll do a third variation on this theme: the ListBox component. You configure this component in almost the same way as the ComboBox component, in that the data is stored as arrays, and the Flash interface handles the syntax writing for you.

Select frame 30 of the components layer. Choose Edit > Paste In Place to paste another instance of the Continue button on the stage. Change its name to q3_btn.

Since the button should still be on your Clipboard, you might as well simplify a step or two and paste it in now. As usual, it's going to need a unique name, which is why you need to enter q3_btn.

Drag out an instance of a ListBox component onto the stage, once again replacing existing components if the Resolve Component Conflict dialog appears.

The list box's parameters look the same as those of the combo box.

With the new list box selected, double-click in the Labels field of the Property inspector, click the + sign four times to add four lines, and enter Minos, Geryon, Cerberus, and Plutus. Click OK. Double-click in the data field, and enter 0, 1, 2, and 3 as the values. Enter q3 as the list box's name.

Again, you are creating a pair of arrays, such that the labels can be associated with the data. When you are finished, the Property inspector should appear as in the screenshot.

Use the free transform tool to adjust the list box so that it fits the values you entered in the previous step.

As with the radio buttons, the combo box appears at a default size, and you need to resize it to fit the actual values that you entered.

At this point, you have built the first three quiz pages. Two more pages follow, which I have already built for you, using radio button components, just to round out the number of questions to five. Take a moment to look them over, but at this point the way they work should be very familiar to you.



Not a subscriber?

Start A Free Trial

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