Skip to main content
Known Participant
December 25, 2020
Question

Drag and drop behavior does not work on ipad and cell phone when published

  • December 25, 2020
  • 3 replies
  • 562 views

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

    This topic has been closed for replies.

    3 replies

    Colin Holgate
    Inspiring
    January 18, 2021

    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-events-in-mobile-safar

    JoãoCésar17023019
    Community Expert
    December 29, 2020

    Hi.

     

    Have you enabled touch interactions? Like this:

    createjs.Touch.enable(stage);

     

    Regards,

    JC

    umrAuthor
    Known Participant
    January 3, 2021

    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

    kglad
    Community Expert
    January 4, 2021

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

    kglad
    Community Expert
    December 28, 2020

    try mouseup and mousedown events on touch devices.

    umrAuthor
    Known Participant
    December 29, 2020

    Still not working,

    works perfect on desktop.

    it does not work on iPad or smartphone.

    any other suggestions ?

    thanks

    usha

    kglad
    Community Expert
    December 29, 2020

    what code did you use with the mouse events?