     }
 
 		private function beginDrag(e:MouseEvent):void {
-      if (e.target is Sprite) {
+      if (e.target.name == 'dragSprite') {
         DOMEventDrag.startDrag(spr);
         //spr.startDrag();
       }
     }
-    private function doDrag(e:MouseEvent):void {
-      if (draggable) {
-        //trace(e.toString());
-        draggable.x = e.stageX;
-        draggable.y = e.stageY;
+    private function endDrag(e:MouseEvent):void {
+      if (e.target.name == 'dragSprite') {
+        DOMEventDrag.stopDrag(spr);
       }
-    }
-    private function endDrag(e:MouseEvent):void {
-      DOMEventDrag.stopDrag(spr);
       //spr.stopDrag();
     }
   }

  import util.DOMEventDrag;
  import flash.display.Sprite;
  import flash.geom.Point;
  import org.windmill.WMBootstrap;

  public class TestAppCode extends MovieClip {

      context = ctxt;
      stg = context.stage;


      // Panel
      var panel:Panel = new Panel();
