Drag and Drop

Explorer ,
Sep 15, 2021 Sep 15, 2021

Copy link to clipboard

Copied

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;}

TOPICS
ActionScript

Views

65

Likes

Translate

Translate

Report

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

correct answers 1 Correct answer

Adobe Community Professional , Sep 15, 2021 Sep 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

Likes

Translate

Translate
Adobe Community Professional ,
Sep 15, 2021 Sep 15, 2021

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

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
Explorer ,
Sep 15, 2021 Sep 15, 2021

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Sep 16, 2021 Sep 16, 2021

Copy link to clipboard

Copied

Hi.

 

I still don't get it.

 

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

 

Regards,

JC

Likes

Translate

Translate

Report

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
Explorer ,
Sep 16, 2021 Sep 16, 2021

Copy link to clipboard

Copied

LATEST

Hi again joao its all good fixed it I played around with the code a bit and its doing the right thing now 🙂 

Likes

Translate

Translate

Report

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
Adobe Community Professional ,
Sep 16, 2021 Sep 16, 2021

Copy link to clipboard

Copied

Great job   JoãoCésar.

You are a code master!


Multimedia Developer, Character Creator, and Animator.

Likes

Translate

Translate

Report

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