I want to create a set of images that will scroll left and right using touch screen input for an iPhone. Im pretty new to AS3, this is what ive come up with so far, it doesnt seem to move the images at all though:
(_1 to _4 are mc containers with the images in)
Code:
Multitouch.inputMode = MultitouchInputMode.GESTURE;
_1.addEventListener(TransformGestureEvent.GESTURE_SWIPE , onSwipe);
_2.addEventListener(TransformGestureEvent.GESTURE_SWIPE , onSwipe);
_3.addEventListener(TransformGestureEvent.GESTURE_SWIPE , onSwipe);
_4.addEventListener(TransformGestureEvent.GESTURE_SWIPE , onSwipe);
function onSwipe (e:TransformGestureEvent):void{
if (e.offsetX == 1) {
//User swiped towards right
_1.x += 100;
_2.x += 100;
_3.x += 100;
_4.x += 100;
}
if (e.offsetX == -1) {
//User swiped towards left
_1.x -= 100;
_2.x -= 100;
_3.x -= 100;
_4.x -= 100;
}
}
any ideas what needs adding?