Skip to main content
Participant
October 31, 2013
Question

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

  • October 31, 2013
  • 1 reply
  • 2505 views

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!

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
October 31, 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;

legan1234Author
Participant
November 2, 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'

Ned Murphy
Legend
November 2, 2013

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