2015-05-14 197 views
0

有誰知道滑動的AS3代碼並轉到下一幀?我是Action Scripting的新手,我正在做一些Flash演示文稿,帶有大量不適合舞臺的幻燈片,因此我更喜歡將每張幻燈片放在每個框架上,但我不知道是什麼是這樣的代碼,它可以像普通幻燈片一樣製作相同的效果。手機觸摸屏的滑動手勢

回答

0

既然你不提什麼或如何「動畫」的「正常」的幻燈片,我只能告訴你是如何完成刷卡:

 import flash.ui.Multitouch; 
     import flash.ui.MultitouchInputMode; 
     import flash.events.TransformGestureEvent; 

     Multitouch.inputMode = MultitouchInputMode.GESTURE; 
     stage.addEventListener(TransformGestureEvent.GESTURE_SWIPE, onSwipe); 

     function onSwipe(e:TransformGestureEvent):void { 
      if (e.offsetX >= 1) { 
       //right swipe 

       //check to make sure you're not on the last frame 
       if(this.currentFrame < this.totalFrames){ 
        this.nextFrame(); 
       }else { 
        this.gotoAndStop(1); //reset to first frame if you want 
       } 
      }else { 
       //left swipe 

       //check to make sure your not on the first frame 
       if(this.currentFrame > 1){ 
        this.prevFrame(); 
       } 
      } 
     }