Ocupé un switch para ver en cual posición estaba y funciona, intento darle un play a la animación, pero no pasa nada.
Este es mi código:
Código ActionScript :
Multitouch.inputMode = MultitouchInputMode.GESTURE; var currentGalleryItem:Number = 1; var totalGalleryItems:Number = 6; 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(){ switch(currentGalleryItem){ case 1: gallery_items.one.play(); trace("slide es 1"); break; case 2: gallery_items.two.play(); trace("slide es 2"); break; case 3: gallery_items.three.play(); trace("slide es 3"); break; case 4: gallery_items.four.play(); trace("slide es 4"); break; case 5: gallery_items.five.play(); trace("slide es 5"); break; case 6: gallery_items.six.play(); trace("slide es 6"); break; } gallery_items.addEventListener("enterFrame", moveGalleryLeft); } function slideRight(){ switch(currentGalleryItem){ case 1: trace("slide es 1"); break; case 2: trace("slide es 2"); break; case 3: trace("slide es 3"); break; case 4: trace("slide es 4"); break; case 5: trace("slide es 5"); break; case 6: trace("slide es 6"); break; } gallery_items.addEventListener("enterFrame", moveGalleryRight); } function moveGalleryLeft(evt:Event){ gallery_items.x -= 138; slideCounter++; if(slideCounter == 10){ gallery_items.removeEventListener("enterFrame", moveGalleryLeft); slideCounter = 0; } } function moveGalleryRight(evt:Event){ gallery_items.x += 138; slideCounter++; if(slideCounter == 10){ gallery_items.removeEventListener("enterFrame", moveGalleryRight); slideCounter = 0; } }