0
votes

I am making a short quiz on Flash using Comboboxes in a table. There are a total of 16 comboboxes (4x4 grid) where each column has a different number of choices in the box.

In the Combobox properties, I assigned a value of 1 or 0 to the data for each label depending on if it is the right answer or not.

What I need to figure out, is how to have the program check the selections and then provide an answer based on if all comboboxes are changed to the correct label (16 points).

I tried a 2-frame quiz with a submit button to advance to the next frame, but received this error message based upon my array coding:

Access of possibly undefined property data through a reference with static type fl.controls:ComboBox.

var aUserAnswers:Array = new Array();

submit_btn.addEventListener(MouseEvent.CLICK,submit);

function submit (event:MouseEvent) :void {
        aUserAnswers.push(Name_1.data, Name_2.data, Name_3.data, Name_4.data, Time_1.data, Time_2.data, Time_3.data, Time_4.data, Location_1.data, Location_2.data, Location_3.data, Location_4.data, Status_1.data, Status_2.data, Status_3.data, Status_4.data);
        nextFrame();
}

How can I use the ComboBox data to score a quiz? How do I set the default value of an unselected ComboBox to 0?

Thanks.

1

1 Answers

0
votes

I don't use the Flash ComboBox (I use the Flex one), but it doesn't look like fl.controls.ComboBox has a data property.

You should use the selectedIndex or selectedItem of the ComboBox to determine which answer the user selected.