Newbie wants to redraw an object before calling another function

So I have chess like game, where I place my piece (c*) on the board,
the piece automatically gets pushed into a square, and the AI starts (computerplay function)

The problem is that the AI is running before the piece get pushed into the nearest square, leaving it hanging oddly over the board for 3 seconds while the computer thinks.

Is there some way to force a redraw before the calling the computerplay function?

function positiontile()
{
c*.removeEventListener(MouseEvent.MOUSE_DOWN, startMove);
c*.removeEventListener(MouseEvent.MOUSE_MOVE, pointMove);
xxx=Math.round((c*.x-80)/38.5);
yyy=Math.round((c*.y-92)/35.5);
c*.x = xxx * 38.5 + 80;
c*.y = yyy * 35.5 + 92;
count = count + 1;
i = bag[count];

computerplay();
}