Skip to main content
Participant
November 8, 2016
Question

Drag & Drop not working properly on iPad (canvas/html5)

  • November 8, 2016
  • 0 replies
  • 633 views

I want to create a simple drag & drop exercise, but on the iPad "drag & drop" is not working properly.

Here is the code:

var that = this;

createjs.Touch.enable(stage);

stage.enableMouseOver(10);

function initPage() {

  var shape = new createjs.Shape();

  shape.graphics.beginFill("#999999").drawRoundRect(100,100,140,60,8).endFill();

  shape.on("mousedown", function(evt) {

    this.alpha = 0.8;

    this.offset = {x: this.x - evt.stageX, y: this.y - evt.stageY};

  });

  shape.on("pressmove", function(evt) {

    this.x = evt.stageX + this.offset.x;

    this.y = evt.stageY + this.offset.y;

  });

  shape.on("pressup", function(evt) {

    this.alpha = 1;

  });

  that.addChild(shape);

}

initPage();

I can drag the shape, but the more I move it, the more it moves away from my finger. Here is a video I just recorded:

https://dl.dropboxusercontent.com/u/11697167/animatecc-bug.mp4

Any ideas what is wrong?

Edit:

Ok it seems the problem lies within the "makeResponsive" function which is part of the default HTML template.

Problem is, if I deactivate it the resolution on the Retina iPad is much worse (but drag & drop is working).

@Adobe, please release a bugfix asap

This topic has been closed for replies.