Skip to main content
Known Participant
September 15, 2021
Answered

Drag and Drop

  • September 15, 2021
  • 1 reply
  • 528 views

How can I stop the other pieces moving  when I drag and drop a piece its a jig saw puzzle 

p1.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag_24);

function fl_ClickToDrag_24(event:MouseEvent):void
{
p1.startDrag();
}

stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop_24);

function fl_ReleaseToDrop_24(event:MouseEvent):void
{
p1.stopDrag();


if(tar1.hitTestObject(p1.hit1))

p1.x=205.2;

p1.y=254.8;}

This topic has been closed for replies.
Correct answer JoãoCésar17023019

Hi.

 

I'm not sure if I understand, but maybe what you want is to set the property mouseEnabled to false in your pieces.

 

Please let us know.

 

Regards,

JC

1 reply

JoãoCésar17023019
Community Expert
JoãoCésar17023019Community ExpertCorrect answer
Community Expert
September 15, 2021

Hi.

 

I'm not sure if I understand, but maybe what you want is to set the property mouseEnabled to false in your pieces.

 

Please let us know.

 

Regards,

JC

Known Participant
September 15, 2021

Thank you for your reply how do I do that? failing this im going to put them in a container see if that works, in the pic you can see when I move one piece all the other pieces move to the x position.

JoãoCésar17023019
Community Expert
Community Expert
September 16, 2021

Hi.

 

I still don't get it.

 

Do you mind sharing a video of the issue you're facing?

 

Regards,

JC