• 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 behavior does not work on ipad and cell phone when published

Community Beginner ,
Dec 25, 2020 Dec 25, 2020

Copy link to clipboard

Copied

Hi I have a simple drag and drop behavior where I can drag an object and drop it where ever on the stage

When i publish it it works on desktop but not ipad and cell phone.

The code I am using is

this.face0.on("pressmove", moveFace);
function moveFace(e){
e.currentTarget.x= e.stageX;
e.currentTarget.y= e.stageY;

}

do I need to modify it for ipad and cell phone.

Your help very much appreciated.

Usha

Views

262

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 ,
Dec 28, 2020 Dec 28, 2020

Copy link to clipboard

Copied

try mouseup and mousedown events on touch devices.

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 Beginner ,
Dec 28, 2020 Dec 28, 2020

Copy link to clipboard

Copied

Still not working,

works perfect on desktop.

it does not work on iPad or smartphone.

any other suggestions ?

thanks

usha

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 ,
Dec 28, 2020 Dec 28, 2020

Copy link to clipboard

Copied

what code did you use with the mouse events?

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 Beginner ,
Dec 28, 2020 Dec 28, 2020

Copy link to clipboard

Copied

this.stop();

this.face0.on("pressmove", moveFace);
function moveFace(e){
e.currentTarget.x= e.stageX;
e.currentTarget.y= e.stageY;

}

 

This works only on desktop, 

mouseUp does not work atall

I just want to move a button and place it elsewhere

I do not need anything more sofisticated.

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 ,
Dec 29, 2020 Dec 29, 2020

Copy link to clipboard

Copied

Hi.

 

Have you enabled touch interactions? Like this:

createjs.Touch.enable(stage);

 

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
Community Beginner ,
Jan 03, 2021 Jan 03, 2021

Copy link to clipboard

Copied

JoaoCesar,

still not working.

I do not know what I am doing wrong.

I saw one of your more complicated ones - drag and drop game which worked on ipad.

It is too complicated for what I need

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 ,
Jan 04, 2021 Jan 04, 2021

Copy link to clipboard

Copied

it's not clear you're following either of our suggestions.

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 Beginner ,
Jan 04, 2021 Jan 04, 2021

Copy link to clipboard

Copied

could be you are right and I am not understanding you both - for I tried both methods and they do not work.

 

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 ,
Jan 04, 2021 Jan 04, 2021

Copy link to clipboard

Copied

show the code you tried (following one of the suggestions) that failed.

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 Beginner ,
Jan 18, 2021 Jan 18, 2021

Copy link to clipboard

Copied

Thanks for trying to help. I just gave up on that project.

Usha

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
LEGEND ,
Jan 18, 2021 Jan 18, 2021

Copy link to clipboard

Copied

LATEST

I see that you gave up on this project, but for anyone else dropping by, something that wasn't mentioned is that you have to prevent the web page itself from reacting to the touch or mouse events. Here's an example stackoverflow discussion about the issue:

https://stackoverflow.com/questions/2890898/preventing-mouse-emulation-events-i-e-click-from-touch-e...

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