When you click on a card make that the 'active' card, then just slide it over to the target...it could be as simple as this:
PHP Code:
var _currentCard:DisplayObject;
function onCardClicked(e:MouseEvent):void{
_currentCard = e.target;
}
function onTargetClicked(e:MouseEvent):void{
TweenLite.to(_currentCard, 1, {x:e.target.x, y:e.target.y});
}
But you probably want to hook up a custom position to each target...for that you'll need a lookup table (dictionary):
PHP Code:
const TARGET_POSITION:Dictionary = new Dictionary();
TARGET_POSITION[target0] = new Point(10, 10);
TARGET_POSITION[target1] = new Point(30, 10);
TARGET_POSITION[target2] = new Point(50, 10);
// ...
var _currentCard:DisplayObject;
function onCardClicked(e:MouseEvent):void{
_currentCard = e.target;
}
function onTargetClicked(e:MouseEvent):void{
var destination:Point = TARGET_POSITION[e.target];
TweenLite.to(_currentCard, 1, {x:destination.x, y:destination.y});
}