• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

Community Beginner ,
Jun 11, 2020 Jun 11, 2020

Copy link to clipboard

Copied

 

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

 

 

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;
});

Views

1.6K

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

correct answers 1 Correct answer

Community Expert , Jun 11, 2020 Jun 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

 

Votes

Translate

Translate
Community Expert ,
Jun 11, 2020 Jun 11, 2020

Copy link to clipboard

Copied

LATEST

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

 

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