Copy link to clipboard
Copied
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!
Copy link to clipboard
Copied
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;
Copy link to clipboard
Copied
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'
Copy link to clipboard
Copied
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