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

Adobe Animate CC JavaScript Code Causing Double Clicking In Mobile

Explorer ,
Jan 04, 2019 Jan 04, 2019

I was told to place this code into Adobe Animate in order to allow mousedown and clicks to work for mobile:

// Enable touch events while allowing the touch events to bubble up to the document.

createjs.Touch.enable( stage, false, true );

// Don't let the stage to automatically prevent default touch events.

stage.preventSelection = false;

This is a sample event listener:

this.HoldChBx.addEventListener("click", CheckBoxClickHandler.bind(this,"Hold"));

The problem is that when I press a button in mobile, it actually double clicks. For example, I have a checkbox. I click for the check to show, but then another click happens again automatically to make the check go away. I don't know why this is happening. I don't have this problem when I try it on my desktop using a mouse. This is bizarre.

I am need stage.preventSelection = false so that the user can still zoom in and out using pinch.

847
Translate
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 Expert ,
Jan 05, 2019 Jan 05, 2019

use a mousedown event.

Translate
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
Explorer ,
Jan 08, 2019 Jan 08, 2019

The problem is that if the user doesn't press down long enough, it has the same issue as using a click event. For example:

this.SelectHold.addEventListener("mousedown", Button_MouseDown.bind(this));

this.SelectHold.addEventListener("pressup", Button_MouseUp.bind(this));

If I press the mouse down and then release quickly, then it reacts the same way as the click event, as if I clicked twice.

Translate
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 Expert ,
Jan 08, 2019 Jan 08, 2019

i don't see a problem, test1_Canvas

Translate
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
Explorer ,
Jan 08, 2019 Jan 08, 2019
LATEST

I can't use my fingers to zoom in or out on mobile using your example.

Translate
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