Copy link to clipboard
Copied
i tried to add simple touch and drag code snippet to a symbol for air to ios.
when testing app on iphone x it doesn't work. why?
/* Touch and Drag Event
Allows the object to be moved by holding and dragging the object.
*/
Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
green.addEventListener(TouchEvent.TOUCH_BEGIN, fl_TouchBeginHandler_2);
green.addEventListener(TouchEvent.TOUCH_END, fl_TouchEndHandler_2);
var fl_DragBounds_2:Rectangle = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
function fl_TouchBeginHandler_2(event:TouchEvent):void
{
event.target.startTouchDrag(event.touchPointID, false, fl_DragBounds_2);
}
function fl_TouchEndHandler_2(event:TouchEvent):void
{
event.target.stopTouchDrag(event.touchPointID);
}
try event.currentTarget instead of event.target
Copy link to clipboard
Copied
try event.currentTarget instead of event.target
Copy link to clipboard
Copied
i thought its ok but still not working:
/* Touch and Drag Event
Allows the object to be moved by holding and dragging the object.
*/
Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
sechvi.addEventListener(TouchEvent.TOUCH_BEGIN, fl_TouchBeginHandler_2);
sechvi.addEventListener(TouchEvent.TOUCH_END, fl_TouchEndHandler_2);
var fl_DragBounds_2:Rectangle = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
function fl_TouchBeginHandler_2(event:TouchEvent):void
{
event.currentTarget.startTouchDrag(event.touchPointID, false, fl_DragBounds_2);
}
function fl_TouchEndHandler_2(event:TouchEvent):void
{
event.currentTarget.stopTouchDrag(event.touchPointID);
}
Copy link to clipboard
Copied
thank you
correct
Copy link to clipboard
Copied
you're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now