Skip to main content
Known Participant
Sep 15, 2021 11:51 AM UTC
Answered

Drag and Drop

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 is closed to new replies. Start a new post to keep the conversation going.
JoãoCésar17023019
JoãoCésar17023019Correct answer
Community Expert
Sep 15, 2021 12:05 PM UTC

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

5 replies

JoãoCésar17023019
Community Expert
JoãoCésar17023019Community ExpertCorrect answer
Community Expert
Sep 15, 2021 12:05 PM UTC

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

Translate
Known Participant
Sep 15, 2021 8:58 PM UTC

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.

Translate
JoãoCésar17023019
Community Expert
Community Expert
Sep 16, 2021 12:07 PM UTC

Hi.

 

I still don't get it.

 

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

 

Regards,

JC

Translate