Copy link to clipboard
Copied
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}
}
}
Copy link to clipboard
Copied
you are never doing anything with your up&down vars, so your conditions for the swipe_handler are never met.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now