# If statement trouble

**URL:** https://forum.kirupa.com/t/if-statement-trouble/222901
**Category:** Uncategorized
**Created:** [April 17, 2007, 8:21pm UTC](https://forum.kirupa.com/t/if-statement-trouble/222901 "2007-04-17T20:21:18Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![oldgreymare](https://avatars.discourse-cdn.com/v4/letter/o/838e76/32.png) [@oldgreymare](https://forum.kirupa.com/u/oldgreymare)
#### Post date: [April 17, 2007, 8:21pm UTC](https://forum.kirupa.com/t/if-statement-trouble/222901/1 "2007-04-17T20:21:18Z")

</div>

Hi folks!  
I thought this was going to be straight forward…  
I have 25 buttons in a grid on the stage named a0 - a24. When you click on a button in a particular row, I want to throw a number/letter combination into an array. I’m just starting out trying to get the code to determine which button was pressed and do a trace action. All it ever traces is the first trace “this button is an f”. What am I doing wrong??? my or’s are right aren’t they? ||

```auto
for(l=0;l<25;l++){
	_root["a"+l].onRelease = function(){
		if(this._name=="a0"||"a5"||"a10"||"a15"||"a20"){
			trace("this is an f button")
		}else if(this._name=="a1"||"a6"||"a11"||"a16"||"a21"){
			trace("this is an r button")
		}else if(this._name=="a2"||"a7"||"a12"||"a17"||"a22"){
			trace("this is an a button")
		}else if(this._name=="a3"||"a8"||"a13"||"a17"||"a23"){
			trace("this is a u button")
		}else if(this._name=="a4"||"a9"||"a14"||"a18"||"a24"){
			trace("this is a d button")
		}
}
}
		

```

Thanks for looking!
