# Function modification

**URL:** <https://forum.kirupa.com/t/function-modification/312733>\
**Category:** Uncategorized\
**Created:** [August 11, 2010, 4:25pm UTC](https://forum.kirupa.com/t/function-modification/312733 "2010-08-11T16:25:23Z")\
**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:** [August 11, 2010, 4:25pm UTC](https://forum.kirupa.com/t/function-modification/312733/1 "2010-08-11T16:25:23Z")

</div>

I have a hittest function for 14 objects, but now I would like to decrease the 14 objects to 12 without losing the 14 objects function. Is there a way to have a perimeter for the objects. The code are attached as below.

```auto

function HitTest(e:MouseEvent) {
   var choarr:Array=new Array(null,cho1,cho2,cho3,cho4,cho5,cho6,cho7,cho8,cho9,cho10,cho11,
     cho12,cho13,cho14);
   for (var i:int = 1; i<=14; i++) {
    var str_i:String=String(i);
    if (e.currentTarget.hitTestObject(choarr*)) {
     if (contain(str_i,select)==1) {
      playsele.push(str_i);
      select=select.removeValue(i);
      trace(select);
      trace(playsele);
      e.currentTarget.stopDrag();
      e.currentTarget.mouseEnabled=false;
      player=false;
      turncheck();
     } else {
      e.currentTarget.startDrag();
     }
    }
   }
  }

```
