Copy link to clipboard
Copied
I've got a problem with this and I couldn't understand it.
Scene 1, Layer 'textentry', Frame 2, Line 7 1061: Call to a possibly undefined method startDrag through a reference with static type flash.display:SimpleButton.
.
I'm trying to do a Drag&Drop by looking a code in the internet.
addChild(mc1);
mc1.x = 0;
mc1.y = 0;
mc1.addEventListener(MouseEvent.MOUSE_DOWN, start_move);
function start_move(evt:MouseEvent):void {
mc1.startDrag();
}
mc1.addEventListener(MouseEvent.MOUSE_UP, stop_move);
function stop_move(e:MouseEvent):void {
mc1.stopDrag();
}
Thanks for your advice.
Chances are that the object you are calling mc1 is not a movieclip symbol but instead a button symbol. Buttons do not have very many properties/methods compared to movieclips, including the startDrag method. Try changing it to be a movieclip symbol and the error should go away.
Copy link to clipboard
Copied
Chances are that the object you are calling mc1 is not a movieclip symbol but instead a button symbol. Buttons do not have very many properties/methods compared to movieclips, including the startDrag method. Try changing it to be a movieclip symbol and the error should go away.
Copy link to clipboard
Copied
Thank you so much.
Copy link to clipboard
Copied
You're welcome
Find more inspiration, events, and resources on the new Adobe Community
Explore Now