How to drag & drop a movie clip with a button in it
Hello!
I'm very much a beginner in ActionScript so please be gentle!
I've got a movie clip that I want to be able to drag and drop on stage, I've added this code to do this:
correct1_mc.addEventListener(MouseEvent.MOUSE_DOWN, pickUp1);
correct1_mc.addEventListener(MouseEvent.MOUSE_UP, dropIt1);
function pickUp1(event:MouseEvent):void {
event.target.startDrag();
}
function dropIt1(event:MouseEvent):void {
event.target.stopDrag();
}
correct1_mc.buttonMode = false;
But because theres a button in it, once you click the button it comes up with this error:
ReferenceError: Error #1069: Property startDrag not found on flash.display.SimpleButton and there is no default value.
at SpeedCameraGame_fla::MainTimeline/pickUp1()
ReferenceError: Error #1069: Property stopDrag not found on flash.display.SimpleButton and there is no default value.
at SpeedCameraGame_fla::MainTimeline/dropIt1()
But the button still does what its supposed to do...but I fear I shouldn't have these errors coming up anyway as (knowing me) I'll run into trouble later on because of it...
I would of thought as long as the button is within the movie clip there wouldn't be a problem dragging it about and such...
Any help would be appreciated!