Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

scene by scene smooth swipe gestures in AS3

Explorer ,
Mar 16, 2014 Mar 16, 2014

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

TOPICS
ActionScript
2.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 16, 2014 Mar 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 16, 2014 Mar 16, 2014

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 17, 2014 Mar 17, 2014

here's the code:

code.jpg

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 25, 2015 Aug 25, 2015
LATEST

could you please do an explanation about this answers?

so you don't use gesture swipe anymore to make it smooth??

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines