Skip to main content
Inspiring
April 22, 2013
Question

Swipe Gestures using Air for ios

  • April 22, 2013
  • 1 reply
  • 323 views

I am trying to do a swipe guesture on a move clip. I want the movie to move up and down when you swipe but I need to make sure it doesn't move too far and get lost.

I don't get any errors with my coding below but I also don't get any respone from it.

If aynone could help that would be great... If anyone has some coding I could use that would be amazing.

Many thanks.

Tim

var up:Boolean=false

var down:Boolean=false

MidsInfo.addEventListener( TransformGestureEvent.GESTURE_SWIPE, onSwipeMids );

function onSwipeMids (e:TransformGestureEvent):void{

if (e.offsetY == 1) {

if(up==true && MidsInfo.y<2000){MidsInfo.y+=4}

}

if (e.offsetY == -1) {

if(down==true && MidsInfo.y>0){MidsInfo.y-=4}

}

}

This topic has been closed for replies.

1 reply

Inspiring
April 22, 2013

you are never doing anything with your up&down vars, so your conditions for the swipe_handler are never met.