I am trying to drag two objects simultaneously with multitouch in AS3. My goal is to have the user pinch the two objects together. Right now I cannot get both to be moving at the same time. Any ideas why this isn't working?
Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
//
bullseye4a.addEventListener(TouchEvent.TOUCH_BEGIN, fl_ClickToDrag4a);
function fl_ClickToDrag4a(event: TouchEvent): void {
bullseye4a.startDrag();
}
bullseye4b.addEventListener(TouchEvent.TOUCH_BEGIN, fl_ClickToDrag4b);
function fl_ClickToDrag4b(event: TouchEvent): void {
bullseye4b.startDrag();
}
bullseye4a.addEventListener(TouchEvent.TOUCH_END, fl_ReleaseToDrop4a);
function fl_ReleaseToDrop4a(event: TouchEvent): void {
bullseye4a.stopDrag();
}
bullseye4b.addEventListener(TouchEvent.TOUCH_END, fl_ReleaseToDrop4b);
function fl_ReleaseToDrop4b(event: TouchEvent): void {
bullseye4b.stopDrag();
}
addChild(bullseye4a);
addChild(bullseye4b);
This is easiest and most direct way to do what you're asking: