Draggable object back to original position when already there is an object at the drop area.
I'm a newbie about flash, especially actionscript.
So the scenario is something like: I have 3 pairs of shoes, 2 ties, and 4 scouts.
I already made the 3 pairs of shoes and 2 ties draggable to any scouts (as the drop area).
But the problem is, I want to make it clear, that the user only may put a pair of shoes and a tie on 1 scout.
Because what I have now is, when already exist a pair of shoes and a tie on a scout, the user still can drop other on it.
Please help me, I've been surfing through internet and many forums but still can't solve this one. Many thanks before.
Here is my code for one of my movie clip
on (press)
{
if (!this.isLocked)
startDrag(this);
}
on (release) {stopDrag();
if(this._droptarget=="/anak1")
{
this._x=193,75;
this._y=358,90;
var efeksound:Sound = new Sound();
efeksound.attachSound("plopp");
efeksound.start();
var isLocked = true;
}
else if(this._droptarget=="/anak2")
{
this._x=324,25;
this._y=358,90;
var efeksound:Sound = new Sound();
efeksound.attachSound("plopp");
efeksound.start();
var isLocked = true;
}
else if(this._droptarget=="/anak3")
{
this._x=453,75;
this._y=358,90;
var efeksound:Sound = new Sound();
efeksound.attachSound("plopp");
efeksound.start();
var isLocked = true;
}
else{
this._x=600,20;
this._y=342,8;
}
}
