I'm making a simple, two-player (no AI) checkers boardgame for a class project. I'm using a drag and drop method. When the selected piece is dropped, first the program checks to see if the move is legal, then if there is another piece occupying the space. If both tests pass, the piece moves to the desired location. Checking for the legality of the move is no problem, but finding out if there is another piece there is causing me headaches. I'm using hitTestObject, and it fails half the time. The source code is below. This is obviously not complete. I'm just trying to get the black pieces working before I code everything else. There are only three groups of objects on the board. Black pieces (blk0 - blk11), white pieces (wht0 - wht 11), and squares (sq0 - sq63).

Code:
package 
{
	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.events.MouseEvent;

	public class Main_Checker extends MovieClip
	{
						
		//Declare variables
		private var _ctX:Number;
		private var _ctY:Number;
		private var _ct:String;
		private var _nt:String;
		private var _ntX:Number;
		private var _ntY:Number;
		private var _isDragging:Boolean;
		private var _legal:Boolean;
		private var _spaceTaken:Boolean;
		
		public function Main_Checker()
		{
			//Initialize variables
			_isDragging = false;
			_spaceTaken = true;
			
			//Add event listeners
			for (var b:int = 0; b <= 11; b++)
			{
				this["blk" + b].addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
			}
			for (var w:int = 0; w <= 11; w++)
			{
				this["wht" + w].addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
			}
			
			addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
			addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
		}
				
		private function onMouseOver(e:MouseEvent):void
		{
			e.target.gotoAndStop(2);
		}
		private function onMouseOut(e:MouseEvent):void
		{
			if (e.target.name != _ct )
			{
				e.target.gotoAndStop(1);
			}
			
		}
		
		private function onMouseUp(e:Event):void
		{
			var currentDragObject:MovieClip = e.currentTarget as MovieClip;
			currentDragObject.stopDrag();
			_isDragging = false;
			currentDragObject.removeEventListener(MouseEvent.MOUSE_UP, onMouseUp);
			
			
			if(currentDragObject.dropTarget != null)
			{
				trace("drop target: " + currentDragObject.dropTarget.parent.name);
				
				if ((_ctY - 50) == currentDragObject.dropTarget.parent.y && (_ctX - 50) == currentDragObject.dropTarget.parent.x)
					{
					_legal = true
					}
				else if ((_ctY - 50) == currentDragObject.dropTarget.parent.y && (_ctX + 50) == currentDragObject.dropTarget.parent.x)
					{
					_legal = true;
					}
				else
					{
					_legal = false;
					}
			}
			
			for (var c:int = 0; c <= 11; c++)
			{
				if (currentDragObject.dropTarget.parent.hitTestObject(this["blk" + c]))
				{
					_spaceTaken = true;
				}
				else
				{
					_spaceTaken = false;
				}
			}
			
			if (_legal == true && _spaceTaken != true)
			{
				this[_ct].x = currentDragObject.dropTarget.parent.x;
				this[_ct].y = currentDragObject.dropTarget.parent.y;
			}
			else
			{
				this[_ct].x = _ctX;
				this[_ct].y = _ctY;
			}
			trace(_spaceTaken + " = space taken " + _legal + " = legal");
		}
		
		private function onMouseDown(e:Event):void
		{
			var currentDragObject:MovieClip = e.currentTarget as MovieClip;
			currentDragObject.startDrag();
			
			for (var b:int = 0; b <= 11; b++)
			{
				if (this["blk" + b] == e.target)
				{
					if (_ct != null)
					{
						this[_ct].gotoAndStop(1);
					}
					
					_ctX = e.currentTarget.x;
					_ctY = e.currentTarget.y;
					_ct = e.currentTarget.name;
					this[_ct].gotoAndStop(2);
					trace("current target = " + _ct + " _ctX = " + _ctX + " _ctyY = " + _ctY);
				}
			}
			setChildIndex(currentDragObject, numChildren-1);
			_isDragging = true;
			currentDragObject.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
		}
}
}