手机触摸屏的滑动手势
问题描述:
有谁知道滑动的AS3
代码并转到下一帧?我是Action Scripting的新手,我正在做一些Flash演示文稿,带有大量不适合舞台的幻灯片,因此我更喜欢将每张幻灯片放在每个框架上,但我不知道是什么是这样的代码,它可以像普通幻灯片一样制作相同的效果。手机触摸屏的滑动手势
答
既然你不提什么或如何“动画”的“正常”的幻灯片,我只能告诉你是如何完成刷卡:
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();
}
}
}