_root.onMouseDown = function() { if (map.hitTest(_xmouse, _ymouse)) { startDrag(map); } }; _root.onMouseUp = function() { stopDrag(); };