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
Copy link to clipboard
Copied
try mouseup and mousedown events on touch devices.
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
Copy link to clipboard
Copied
what code did you use with the mouse events?
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.
Copy link to clipboard
Copied
Hi.
Have you enabled touch interactions? Like this:
createjs.Touch.enable(stage);
Regards,
JC
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
Copy link to clipboard
Copied
it's not clear you're following either of our suggestions.
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.
Copy link to clipboard
Copied
show the code you tried (following one of the suggestions) that failed.
Copy link to clipboard
Copied
Thanks for trying to help. I just gave up on that project.
Usha
Copy link to clipboard
Copied
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: