Skip to main content
Inspiring
June 27, 2011
Question

TOUCH_BEGIN bug on motorola droid2 only

  • June 27, 2011
  • 1 reply
  • 295 views

I seem to be running into a problem where on TOUCH_BEGIN may intermittently read the data of a different existing touch point.

This does not happen on my droidX or ipod4, but it does happen on Motorola droid2 running Air2.7.

below is an example, if anyone has a droid2 please try and confirm this for me:

-press and hold clircle1, then press and hold circle2

-while still holding circle2 start to tap circle1

on touch Begin, you will see event.stageX is intermittently reporting the value for the other touch point your still holding.

Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;

//draw stuff

var circle1:Sprite= new Sprite();
circle1.graphics.beginFill(0x000000);
circle1.graphics.drawCircle(100,500,70);
circle1.graphics.endFill();
addChild(circle1);

var circle2:Sprite= new Sprite();
circle2.graphics.beginFill(0x000000);
circle2.graphics.drawCircle(400,500,70);
circle2.graphics.endFill();
addChild(circle2);

var txt1:TextField= new TextField();
addChild(txt1);

var format:TextFormat = new TextFormat();
format.size = 26;
txt1.defaultTextFormat = format;


///////////////
// the example
stage.addEventListener(TouchEvent.TOUCH_BEGIN, touchBegin);
stage.addEventListener(TouchEvent.TOUCH_END, touchEnd);

function touchBegin(e:TouchEvent) {

    if (e.target == circle1) {
        txt1.text = e.stageX.toString();
    } else if (e.target==circle2) {
        txt1.text = e.stageX.toString();
    }
}

function touchEnd(e:TouchEvent) {
    txt1.text = "";
}

1 touch point works normal. 2 touch points intermittently causes the glitch.

(i also see some lag on the touch event w/ droid2 which is not present on other devices)

This topic has been closed for replies.

1 reply

arnd_dc
Participant
August 1, 2011

Maybe you should Set the position .x and .y of those clips to different locations? when just using addChild, they will be both set to 0,0. try it out.