0 Replies Latest reply on Aug 25, 2015 12:00 PM by craziecattie

    Gesture Swipe Problems in Flash

    craziecattie

      Hi I'm planning to make a digital magazine with adobe flash cc 2014. I have different scenes for different page and I use Gesture_SWIPE to navigate the magazine.

      The problem is, I only write the script in 1 scene but  it worked for all the scenes. So I can do the swipe in all scenes.

      While I want each scenes have a different action such as only page 1 that can't be swiped to the left, only page 2 can be swiped up and down and etc

      I did use the if else in each case, it worked for the swiped left, but not working for the swipe right.

      Can you please help me, How can I make this scripts work only for 1 scene?

      Thank you in advance!

       

      this is my gesture swipe code

       

      import flash.events.TransformGestureEvent;
      
      
      Multitouch.inputMode = MultitouchInputMode.GESTURE;
      
      
      stage.addEventListener(TransformGestureEvent.GESTURE_SWIPE, SwipeHandler);
      
      
      function SwipeHandler(event:TransformGestureEvent):void
      {
        switch(event.offsetX)
        {
             case 1: //swiped right
             {
                  prevScene();
                  break;
                  if(this.currentScene.name == "Scene 1") //THIS ONE DIDN'T WORK
                  {
                       stop();
                  }
      
             }
             case -1: //swiped left
             {
                  if(this.currentScene.name == "Scene 12") //THIS ONE WORK
                  {
                       stop();
                  }
                  else
                  {
                       nextScene();
                       break;
                  }
      
             }
        }
      }