Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Aug 27, 2017 Aug 27, 2017

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.

TOPICS
ActionScript
4.3K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Aug 27, 2017 Aug 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.

Translate
LEGEND ,
Aug 27, 2017 Aug 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 27, 2017 Aug 27, 2017

Thank you so much.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 28, 2017 Aug 28, 2017
LATEST

You're welcome

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines