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

Drag and drop - 1084Syntas error: expecting identifier before rightparen

New Here ,
Oct 30, 2013 Oct 30, 2013

Hi guys!

I am so unbelievable new to flash in general. I need help desperately! I have spent way too long searching google to try and find an answer to this. But I am trying to use drag and drop but my code keeps coming up wtih this error "Scene 1, Layer 'Actions', Frame 1, Line 20, Column 2 1084: Syntax error: expecting identifier before rightparen."

here is the code I am using

Doctor_mc.addEventListener(MouseEvent.MOUSE_DOWN, drag);

Doctor_mc.addEventListener(MouseEvent.MOUSE_UP, dropMusic_mc)

function drag (event:MouseEvent)

{

     event.currentTarget.startDrag();

}

function dropDoctor_mc(event:MouseEvent)

{

     stopDrag();

     if(Doctor_mc.hitTestObject(Doctortarget_mc))

     (

          Doctor_mc.x = Doctortarget_mc.x());

          Doctor_mc.y = Doctortarget_mc.y();

     )

}

PLEASE HELP!

TOPICS
ActionScript
2.5K
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
Community Expert ,
Oct 30, 2013 Oct 30, 2013

these lines:

      Doctor_mc.x = Doctortarget_mc.x());

          Doctor_mc.y = Doctortarget_mc.y();

should be

      Doctor_mc.x = Doctortarget_mc.x;

          Doctor_mc.y = Doctortarget_mc.y;

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 ,
Nov 01, 2013 Nov 01, 2013

Thanks Kglad but I entered that and now it has come up with 'scene 1,layer actions, frame 1, line 15, column 34 1084; syntas error: expecting rightparen before semicolon' and 'scene 1, layer actions, frame 1, line 17, column 3 1084: syntax error: expecting identifier before rightparen'

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 ,
Nov 01, 2013 Nov 01, 2013
LATEST

One set of parentheses should be curly braces...

     if(Doctor_mc.hitTestObject(Doctortarget_mc))

     {                                                                         //  <-- here

          Doctor_mc.x = Doctortarget_mc.x;

          Doctor_mc.y = Doctortarget_mc.y;

     }                                                                         //  <-- here

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