Swipe event controls timeline
Hi!...
I am sorry about my silly questions but i really need your help...
I need to create an app for a touch screen where I move the screen along a landscape where I will have buttons with some information. The problem is I would like to move the landscape swiping the finger on a touch screen.
Is there any way I can use a swipe event to change frames along the time line? if so is there a way I can control only part of the timeline? I need to have some places (frames) where the swipe doesn't work.
I want to publish with AIR for desktop and I am using the latest animate cc (19.2) andI have been trying to use this code but it's not working very well...
stage.addEventListener(MouseEvent.MOUSE_DOWN, mDown);
stage.addEventListener(MouseEvent.MOUSE_UP, mUp);
var prevMouseX:int;
function mDown(event:MouseEvent):void {
prevMouseX = stage.mouseX;
this.addEventListener(Event.ENTER_FRAME,mMove);
}
function mUp(event:MouseEvent):void {
this.removeEventListener(Event.ENTER_FRAME,mMove);
}
function mMove(event:Event):void {
var activeMouseX = stage.mouseX;
if (activeMouseX > prevMouseX){
if(currentFrame == 1){
gotoAndStop(totalFrames);
} else {
prevFrame()
}
}
if (activeMouseX < prevMouseX){
if(currentFrame == totalFrames) {
gotoAndStop(1);
} else {
nextFrame()
}
}
prevMouseX = stage.mouseX
