Hi I'm trying to recreate a board game and want to know how to get the pieces to be removed if surrounded on 4 sides.

function onClick(e:MouseEvent):void
{
if (counterBlack == counterWhite)
{
var black:stoneBlack = new stoneBlack();
//other code for sizing positioning etc.
addChild(black);
counterBlack++;
}
else
{
var white:stoneWhite = new stoneWhite();
//other code for sizing positioning etc.
addChild(white);
counterWhite++;
}
}

the stoneWhite and stoneBlack classes are empty classes. the counterBlack and counterWhite determine which person's turn it is