# Stuck with complex if conditions :S Need Help Here

**URL:** <https://forum.kirupa.com/t/stuck-with-complex-if-conditions-s-need-help-here/291968>\
**Category:** Uncategorized\
**Created:** [July 8, 2009, 12:14pm UTC](https://forum.kirupa.com/t/stuck-with-complex-if-conditions-s-need-help-here/291968 "2009-07-08T12:14:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![swerheatz](https://avatars.discourse-cdn.com/v4/letter/s/f08c70/32.png) [@swerheatz](https://forum.kirupa.com/u/swerheatz)\
**Post date:** [July 8, 2009, 12:14pm UTC](https://forum.kirupa.com/t/stuck-with-complex-if-conditions-s-need-help-here/291968/1 "2009-07-08T12:14:34Z")

</div>

I am trying to make an educational script and I must use conditionals to detect how my movieclips are gonna act. I have two buttons and if they are clicked their related variable equals to 1. if not pressed their variables are 0. I put a button to see their state (if 1 or 0) and trace the variables. I am sending Fla to check if I am making any mistakes…

:(:wasted::wasted:

even I click different buttons to change the variables, I always get the same trace…

```php
var released:Number;
var pump_situation:Number;

serbestbirak.addEventListener(MouseEvent.CLICK, serbestbirakma);
function serbestbirakma(event:MouseEvent):void {

	if (event.type=="click"){
		released=1;
	}
	else{

		released=0;
	}
}

pump_outside.addEventListener(MouseEvent.CLICK, disari);
function disari(event:MouseEvent):void {
	
	if(event.type=="click")
{
		pump_situation==1;}
}
pump_inside.addEventListener(MouseEvent.CLICK, iceri);
function iceri(event:MouseEvent):void {
	
	if(event.type=="click")
{
		pump_situation=0;}

}

tracing.addEventListener(MouseEvent.CLICK, trascing);
function trascing(event:MouseEvent):void 
{
	if ((pump_situation==1) && (released!=1))
	{ 
	trace("pump_situation1, released is not 1 ");
	
	}
	if ((pump_situation ==1) && (released==1))
	{
		trace("pump_situation 1 released 1");
	}
	
	if ((pump_situation ==0) && (released==1))
	{
		trace("pump_situation 0 released 1");
	}
	if ((pump_situation ==0) && (released!=1))
	{
		trace("pump_situation 0 released is not 1");
	}
	else
{
trace("none of them");
}
}

```
