# hitTestObject THEN snap back?

**URL:** <https://forum.kirupa.com/t/hittestobject-then-snap-back/319970>\
**Category:** Uncategorized\
**Created:** [March 10, 2011, 3:36am UTC](https://forum.kirupa.com/t/hittestobject-then-snap-back/319970 "2011-03-10T03:36:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![arove](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@arove](https://forum.kirupa.com/u/arove)\
**Post date:** [March 10, 2011, 3:36am UTC](https://forum.kirupa.com/t/hittestobject-then-snap-back/319970/1 "2011-03-10T03:36:23Z")

</div>

I THOUGHT THIS WOULD SNAP (choice\_1) BACK INTO PLACE AFTER HITTING TEST OBJECT. WHAT DID I DO WRONG?

import flash.net.URLVariables;  
import flash.net.URLRequest;

var origX:Number;  
var origY:Number;

/\* Drag and Drop  
Makes the specified symbol instance moveable with drag and drop.  
\*/  
origX = x;  
origY = y;

choice\_1.buttonMode = true;  
choice\_1.mouseChildren = false;  
choice\_1.addEventListener(MouseEvent.MOUSE\_DOWN, fl\_ClickToDrag);

function fl\_ClickToDrag(event:MouseEvent):void  
{  
choice\_1.startDrag();  
}

stage.addEventListener(MouseEvent.MOUSE\_UP, fl\_ReleaseToDrop);

function fl\_ReleaseToDrop(event:MouseEvent):void  
{  
choice\_1.stopDrag();

if(choice\_1.hitTestObject(box\_1))  
{  
box\_1.text = choice\_1.text;  
}

x = origX;  
y = origY;  
}

Thank you so much in advance for any help! 🙂
