i have this quiz (code below), and i can’t get the option1 variable to display the if statement not else. when i click on option1 it gives me “wrong. try again” in the dynamic text box that is used for answers.
stop();
var optionsArray:Array = new Array(option1, option2, option3);
var loopCount:int = 0;
for(loopCount = 0; loopCount < optionsArray.length; ++loopCount){
optionsArray[loopCount].addEventListener(Event.CHANGE, checkboxInputChange);
}
function checkboxInputChange(e:Event):void
{
if(e.currentTarget.selected == true){
for(loopCount = 0; loopCount < optionsArray.length; ++loopCount){
if(optionsArray[loopCount] != e.currentTarget){
optionsArray[loopCount].selected = false;
}
}
}
}
option1.addEventListener(MouseEvent.MOUSE_DOWN, goNext);
option2.addEventListener(MouseEvent.MOUSE_DOWN, goNext);
option3.addEventListener(MouseEvent.MOUSE_DOWN, goNext);
updateView()
nextButton.visible = false
function updateView():void
{
question.text = “There are some signs that there is potential conflict here what do you think is the underlying cause?”;
}
function goNext(e:MouseEvent):void
{
if(option1.selected == true){
//The user was right
option2.enabled == false || option3.enabled == false;
answer.text = “”;
answer.text = “Correct!”;
nextButton.visible = true;
}else (option1.selected == false);
//The user was wrong
option2.enabled == true || option3.enabled == true;
answer.text = "";
answer.text = "Wrong try again!";
}