Skip to main content
Known Participant
June 11, 2020
Answered

Animate cc Html5 canvas "pressmove" is not working in mobile browser.

  • June 11, 2020
  • 1 reply
  • 1820 views

 

Hi All,

I have gone through the post below and inmplemented "createjs.Touch.enable(stage);" code into my script but still it's not working in android mobile browser. Also when I click and hold then target object moves out of stage or somewhere far from cursor location. Is can anyone help me with code?

Related Post: https://community.adobe.com/t5/animate/publishing-html5-with-javascript-for-all-devices/m-p/10367066?page=1#M191429

 

 

My code:


var stage = new createjs.Stage("myCanvas");
createjs.Touch.enable(stage);

this.square.on("pressmove",function(evt) {
evt.currentTarget.x = evt.stageX;
evt.currentTarget.y = evt.stageY;
});

    This topic has been closed for replies.
    Correct answer JoãoCésar17023019

    Hi.

     

    By default Animate already creates an instance of the Stage class called stage. Maybe this is what's causing the problem.

     

    And to correctly apply a drag behavior without getting any offset, please watch this tutorial:

     

     

    Regards,

    JC

     

    1 reply

    JoãoCésar17023019
    Community Expert
    JoãoCésar17023019Community ExpertCorrect answer
    Community Expert
    June 11, 2020

    Hi.

     

    By default Animate already creates an instance of the Stage class called stage. Maybe this is what's causing the problem.

     

    And to correctly apply a drag behavior without getting any offset, please watch this tutorial:

     

     

    Regards,

    JC