# Hittest with multiple array issue

**URL:** https://forum.kirupa.com/t/hittest-with-multiple-array-issue/284594
**Category:** flash
**Created:** [March 20, 2009, 4:10pm UTC](https://forum.kirupa.com/t/hittest-with-multiple-array-issue/284594 "2009-03-20T16:10:30Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![thewebguy777](https://avatars.discourse-cdn.com/v4/letter/t/8dc957/32.png) [@thewebguy777](https://forum.kirupa.com/u/thewebguy777)
#### Post date: [March 20, 2009, 4:10pm UTC](https://forum.kirupa.com/t/hittest-with-multiple-array-issue/284594/1 "2009-03-20T16:10:30Z")

</div>

The Setup: For each movieclip the hittests a set of “target” movieclips an array is given a value. If mcIcon1 is dropped onto mcTarget1 the first number in the vacant array is given the value of one.

The Issue: If I remove mcIcon1, for example, from the mcTarget1 movieclip I can’t find a way of just removing the 1 from that array without the rest of the array numbers being reset. Any suggestions?

```auto

function IconCheck(){
	for (i=0; i< 10; i++) {
		currentTarget = blankTargets*;
		if (currentTarget.hitTest(mainIcon) && vacant* == 0) {
			var myTween:Tween = new Tween(mainIcon, "_y", mx.transitions.easing.Strong.easeOut, mainIcon._y, currentTarget._y, .5, true);
			var myTween:Tween = new Tween(mainIcon, "_x", mx.transitions.easing.Strong.easeOut, mainIcon._x, currentTarget._x, .5, true);
			//trace("It's cool there's nothing here yet.");
			vacant* = 1;
			trace(vacant);
			break;
		} else {
			var myTween:Tween = new Tween(mainIcon, "_y", mx.transitions.easing.Strong.easeOut, mainIcon._y, 34, .5, true);
			var myTween:Tween = new Tween(mainIcon, "_x", mx.transitions.easing.Strong.easeOut, mainIcon._x, thisx, .5, true);
		}
	}
}

mcIcon1.onPress = function() {
	startDrag(this, false, 5, 25, 650, 180);
}

mcIcon1.onRelease = mcIcon1.onReleaseOutside=function () {
	mcIcon1.stopDrag();
	thisx = i1x; //The variable thisx is used for the x value animations below.
	mainIcon = mcIcon1; //mainIcon tells the function IconCheck which icon to check.
	IconCheck()
}

```
