• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

257

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

Community Expert , 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

Votes

Translate

Translate
Community Expert ,
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

Votes

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.

Votes

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
Community Expert ,
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

Votes

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 🙂 

Votes

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

Copy link to clipboard

Copied

Great job   JoãoCésar.

You are a code master!

Votes

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