# Simpler ways?

**URL:** <https://forum.kirupa.com/t/simpler-ways/310763>\
**Category:** Uncategorized\
**Created:** [June 18, 2010, 2:33pm UTC](https://forum.kirupa.com/t/simpler-ways/310763 "2010-06-18T14:33:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![blackout188](https://avatars.discourse-cdn.com/v4/letter/b/dec6dc/32.png) [@blackout188](https://forum.kirupa.com/u/blackout188)\
**Post date:** [June 18, 2010, 2:33pm UTC](https://forum.kirupa.com/t/simpler-ways/310763/1 "2010-06-18T14:33:57Z")

</div>

The following code is what I have right now. The code’s job is to check which object did ac8 hit, from cho14 to cho1 and then do what’s after. Is there anyway to simplify the following code instead of \<code\> if (ac8.hitTestObject(cho14)) to if (ac8.hitTestObject(cho1))\</code\>

\<code\>  
function ac8b (Event:MouseEvent){  
var ac8 = getChildByName(“ac8”);  
ac8.stopDrag()  
if (ac8.hitTestObject(cho14)) {  
myglobal.playsele.push(“14”)  
select=select.removeValue(14)  
ac8.mouseEnabled=false  
trace(select)  
trace(myglobal.playsele)

}  
if (ac8.hitTestObject(cho13)) {  
myglobal.playsele.push(“13”)  
select=select.removeValue(13)  
cho13.mouseEnabled=false  
trace(select)  
trace(myglobal.playsele)  
}  
player=false  
turncheck()  
}

\</code\>
