Highlighted

Adobe Animate CC JavaScript Code Causing Double Clicking In Mobile

Explorer ,
Jan 04, 2019

Copy link to clipboard

Copied

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.

Views

291

Likes

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

Adobe Animate CC JavaScript Code Causing Double Clicking In Mobile

Explorer ,
Jan 04, 2019

Copy link to clipboard

Copied

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.

Views

292

Likes

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
Jan 04, 2019 0
Adobe Community Professional ,
Jan 05, 2019

Copy link to clipboard

Copied

use a mousedown event.

Likes

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
Reply
Loading...
Jan 05, 2019 0
Explorer ,
Jan 08, 2019

Copy link to clipboard

Copied

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.

Likes

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
Reply
Loading...
Jan 08, 2019 0
Adobe Community Professional ,
Jan 08, 2019

Copy link to clipboard

Copied

i don't see a problem, test1_Canvas

Likes

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
Reply
Loading...
Jan 08, 2019 1
Explorer ,
Jan 08, 2019

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Jan 08, 2019 0