Updated
Trying to create a quiz where you select an answer in a comboBox, hitting a submit button and a dynamic text area telling you if the answer is correct or not.
Cant figure out the proper scripting. The comboBox and button work on their own until I add the action script to the submit button then it just keeps looping.
This is the action script I've tried to use on the submit button: "box" refers to the comboBox "answer" refers the the dynamic text
submitBtn.addEventListener(MouseEvent.MOUSE_UP, submit);
function submit(evt:Event):void{
if (box.getValue() != "65°") {
answer = "Wrong";
}
else if (box.getValue() == "65°") {
answer = "Correct";
}
}
These are the errors im getting
Scene 1, Layer 'submitBtn', Frame 1, Line 4, Column 10 1061: Call to a possibly undefined method getValue through a reference with static type fl.controls:ComboBox.
Scene 1, Layer 'submitBtn', Frame 1, Line 5, Column 12 1067: Implicit coercion of a value of type String to an unrelated type flash.text:TextField.
Scene 1, Layer 'submitBtn', Frame 1, Line 7, Column 15 1061: Call to a possibly undefined method getValue through a reference with static type fl.controls:ComboBox.
Scene 1, Layer 'submitBtn', Frame 1, Line 8, Column 12 1067: Implicit coercion of a value of type String to an unrelated type flash.text:TextField.
Any help would be great