# AS3 simple IF/ELSE problem

**URL:** <https://forum.kirupa.com/t/as3-simple-if-else-problem/324637>\
**Category:** Uncategorized\
**Created:** [August 31, 2011, 12:14pm UTC](https://forum.kirupa.com/t/as3-simple-if-else-problem/324637 "2011-08-31T12:14:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![somdow](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@somdow](https://forum.kirupa.com/u/somdow)\
**Post date:** [August 31, 2011, 12:14pm UTC](https://forum.kirupa.com/t/as3-simple-if-else-problem/324637/1 "2011-08-31T12:14:17Z")

</div>

Hello all.

so im trying to write a smooth transition peice and…i dont know what happ…too tired,  
anyways i left it last night and it was working…i think, now its not.

here it is.

```auto
function btnclick(event:Event):void{
	

	if(event.target == load1 || load2) {
		   trace("working");
		  } else {
			   trace("not ");
		   }
	
}

```

on my stage, i have 3 buttons, all point to the name btnclick function, the 3 buttons instances are  
load1, load2 and load3.

when i click buttons load 1 or 2, i get the trace “working”, when i press button load 3, i still get “working” when its supposed to say “not”

just to check i changed it to this:

```auto
function btnclick(event:Event):void{
	

	if(event.target == load1 || load2) {
		   trace("working");
		  } else if (event.target == load3){
			   trace("not ");
		   }
	
}

```

and the same problem, they all say “working”

any ideas what it is im missing?
