Skip to main content
Ratchaxxx
Participant
August 27, 2017
Answered

1061: Call to a possibly undefined method startDrag through a reference with static type flash.display:SimpleButton.

  • August 27, 2017
  • 1 reply
  • 4373 views

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.

This topic has been closed for replies.
Correct answer Ned Murphy

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.

1 reply

Ned Murphy
Ned MurphyCorrect answer
Legend
August 27, 2017

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.

Ratchaxxx
RatchaxxxAuthor
Participant
August 27, 2017

Thank you so much.

Ned Murphy
Legend
August 28, 2017

You're welcome