Using simple functions like this to drag and drop something works perfectly:
messageBox.addEventListener(MouseEvent.MOUSE_DOWN, pickUp);
messageBox.addEventListener(MouseEvent.MOUSE_UP, dropIt);
function pickUp(event:MouseEvent):void {
event.target.startDrag(true);
}
function dropIt(event:MouseEvent):void {
event.target.stopDrag();
}
But when you click on the object anywhere it moves it and drags it from its registration point. Is there any way to disable this so that it will drag it from anywhere I click on it?