Copy link to clipboard
Copied
Hi, I am using this action script to create a simple swipe App.
/* Swipe to Go to Next/Previous Scene and Play
Swiping the stage moves the playhead to the next/previous scene in the timeline and continues playback in that scene.
*/
Multitouch.inputMode = MultitouchInputMode.GESTURE;
stage.addEventListener (TransformGestureEvent.GESTURE_SWIPE, fl_SwipeToGoToNextPreviousScene_5);
function fl_SwipeToGoToNextPreviousScene_5(event:TransformGestureEvent):void
{
if(event.offsetX == 1)
{
// swiped right
prevScene();
}
else if(event.offsetX == -1)
{
// swiped left
nextScene();
}
}
This works fine if I only have two scenes but I have more than that. At the moment it will reset to the start and not go past scene 2.
Do I need to amend this code here?
if(event.offsetX == 1)
{
// swiped right
prevScene();
}
else if(event.offsetX == -1)
{
// swiped left
nextScene();
}
}
Any advice would be helpful.
Thanks
you need to add a stop() to each scene.
Copy link to clipboard
Copied
you need to add a stop() to each scene.
Copy link to clipboard
Copied
Thank you, will give it a try.
Copy link to clipboard
Copied
you're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now