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

138

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

Copy link to clipboard

Copied

try mouseup and mousedown events on touch devices.

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

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

Copy link to clipboard

Copied

what code did you use with the mouse events?

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
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.

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

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

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

Copy link to clipboard

Copied

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

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
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.

 

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

Copy link to clipboard

Copied

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

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

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 ,
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...

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