Swipe more than one movie clip
Hi,
is it possible to have the swipe function work on more than one movie clip?
I have got it working no problem on a single movie clip using the code snippet provided.
But I would like to have two movie clips which I can swipe independently.
Both movie clips are positioned off-screen above the stage and are called individually - so that only one movie clip is visible at any point in time. I've got that part sorted no problem.
It's just being able to swipe each of those movie clips independently so one doesn't affect the other.
I've attached an image of the layout I am trying to achieve:

========================= This is where I've got to with the code based on the swipe code snippet provide ===================================
/* Swipe to Go to Next/Previous Frame and Stop
Swiping the stage moves the playhead to the next/previous frame and stops the movie.
*/
Multitouch.inputMode = MultitouchInputMode.GESTURE;
var currentGalleryItem:Number = 1;
var totalGalleryItems:Number = 17;
stage.addEventListener (TransformGestureEvent.GESTURE_SWIPE, fl_SwipeToGoToNextPreviousFrame);
function fl_SwipeToGoToNextPreviousFrame(event:TransformGestureEvent):void
{
if(event.offsetX == 1)
{
if(currentGalleryItem > 1){
currentGalleryItem--;
slideRight();
}
}
else if(event.offsetX == -1)
{
if(currentGalleryItem < totalGalleryItems){
currentGalleryItem++;
slideLeft();
}
}
}
var slideCounter:Number = 0;
function slideLeft(){
segpanel1.addEventListener("enterFrame", moveGalleryLeft);
}
function slideRight(){
segpanel1.addEventListener("enterFrame", moveGalleryRight);
}
function moveGalleryLeft(evt:Event){
segpanel1.x -= 48;
slideCounter++;
if(slideCounter == 10){
segpanel1.removeEventListener("enterFrame", moveGalleryLeft);
slideCounter = 0;
}
}
function moveGalleryRight(evt:Event){
segpanel1.x += 48;
slideCounter++;
if(slideCounter == 10){
segpanel1.removeEventListener("enterFrame", moveGalleryRight);
slideCounter = 0;
}
}
/* Seg panel 2*/
var slideCounter2:Number = 0;
function slideLeft2(){
segpanel2.addEventListener("enterFrame", moveGalleryLeft2);
}
function slideRight2(){
segpanel2.addEventListener("enterFrame", moveGalleryRight2);
}
function moveGalleryLeft2(evt:Event){
segpanel2.x -= 48;
slideCounter++;
if(slideCounter == 10){
segpanel2.removeEventListener("enterFrame", moveGalleryLeft2);
slideCounter = 0;
}
}
function moveGalleryRight2(evt:Event){
segpanel2.x += 48;
slideCounter++;
if(slideCounter == 10){
segpanel2.removeEventListener("enterFrame", moveGalleryRight2);
slideCounter = 0;
}
}
stop();
========================= End of code ===================================
I know I've tied myself in knots and I'm hoping the answer is quite straight-forward.
Be grateful for any advice.
Thanks
