# Easy Conditional Statement, but not working

**URL:** <https://forum.kirupa.com/t/easy-conditional-statement-but-not-working/316562>\
**Category:** flash\
**Created:** [November 25, 2010, 6:26pm UTC](https://forum.kirupa.com/t/easy-conditional-statement-but-not-working/316562 "2010-11-25T18:26:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kristo](https://avatars.discourse-cdn.com/v4/letter/k/3ab097/32.png) [@kristo](https://forum.kirupa.com/u/kristo)\
**Post date:** [November 25, 2010, 6:26pm UTC](https://forum.kirupa.com/t/easy-conditional-statement-but-not-working/316562/1 "2010-11-25T18:26:42Z")

</div>

Hi,

Two Movie Clips “movie1” and “movie2” are on the scene. The following code should output a trace message. It does not. Why?

Here is a piece of code:  
var A:Boolean = false;  
var B:Boolean = false;

movie1.addEventListener(MouseEvent.CLICK, onMovie1Click);  
movie2.addEventListener(MouseEvent.CLICK, onMovie2Click);

function feedback():void{  
if(A && B){  
trace(“Hello”);  
}  
}

function onMovie1Click(event:MouseEvent):void{  
A = true;  
feedback();  
}

function onMovie2Click(event:MouseEvent):void{  
B = true;  
feedback();  
}
