> Drag and Drop in Flash CS6 with AS3.my code does not work properly.?

Drag and Drop in Flash CS6 with AS3.my code does not work properly.?

Posted at: 2014-12-18 
I have 6 shapes and I want to drag them to a specific locations

but without butting one above the other

I try to use if statment

It works but makes a problem

when I drag the last shape , It does not stopped till I click on that location .

part of my code:

public function drag(e:MouseEvent):void

{





e.target.startDrag();





}

public function drop(e:MouseEvent):void

{

var hg=e.target.name;



if (e.target.hitTestObject(tt))

{

if (fo==1)

{



stopDrag();

e.target.x=bb.x;

e.target.y=bb.y;

fo++; // this to prevent drag another shape at the same location again

if(hg=="vvvv")

{

zzz=true;

trace(zzz);



}