# as3 help

**URL:** <https://forum.kirupa.com/t/as3-help/306866>\
**Category:** flash\
**Created:** [March 23, 2010, 6:12pm UTC](https://forum.kirupa.com/t/as3-help/306866 "2010-03-23T18:12:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikalh78](https://avatars.discourse-cdn.com/v4/letter/m/dbc845/32.png) [@mikalh78](https://forum.kirupa.com/u/mikalh78)\
**Post date:** [March 23, 2010, 6:12pm UTC](https://forum.kirupa.com/t/as3-help/306866/1 "2010-03-23T18:12:10Z")

</div>

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 &lt; 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!";        
    
    }
```
