Skip to main content
Inspiring
March 16, 2014
Question

scene by scene smooth swipe gestures in AS3

  • March 16, 2014
  • 1 reply
  • 2133 views

hi, I’m trying to make scene by scene swiping for may ipad and andriod application. i try this code but…..

Multitouch.inputMode = MultitouchInputMode.GESTURE;

stage.addEventListener (TransformGestureEvent.GESTURE_SWIPE, fl_SwipeToGoToNextPreviousScene);

     function fl_SwipeToGoToNextPreviousScene(event:TransformGestureEvent):void

     {

           if(event.offsetX == 1)

           {

                  // swiped right

                  prevScene();

           }

           else if(event.offsetX == -1)

           {

                  // swiped left

                  nextScene();

      } 

}


its not working perfect. please help me for this

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
March 16, 2014

if you're trying to duplicate the ios swipe, there's no easy way.  i just posted code for mimicking the swipe for a scrolling movieclip, but that (and nothing else) will work to mimic a swipe from one scene (or frame) to another.

71081Author
Inspiring
March 17, 2014

boss can you give me URL where you posted the code??

kglad
Community Expert
Community Expert
March 17, 2014

here's the code: