3 Replies Latest reply on Jul 26, 2016 4:06 PM by kglad

    Animate CC Image Slideshow Carousel

    rezun8 Level 4

      Hey everyone, I have a .Fla file that needs to be converted to Canvas. My issue lies in the correct scripting of the image Carousel that is on the end frame. There will be 4 logos that slide in left to right and depending on button clicked will either swipe left or swipe right essential a basic Image Carousel. The following code works perfect in AS3. I'm struggling to convert it and it keeps the banner from working/playing. What am I missing?

       

      code is on end frame of timeline.

       

      var count: Number = 0;

       

       

      //an array with the images  x - coordinate

      //add more coordinates based on number of images used - 3coordinates = 3 logos

      var imagePos: Array = [7, -140, -265];

       

       

      var imgLength = imagePos.length - 1;

       

       

      //left button = CarBtnLeft

      this.CarBtnLeft.addEventListener("mouseDown", buttonLeftPress);

      this.CarBtnLeft.visible = true;

       

       

      //right button = CarBtnRight

      this.CarBtnRight.addEventListener("mouseDown", buttonRightPress);

      this.CarBtnRight.visible = true;

       

       

       

       

      //left button press

      function buttonRightPress(e: MouseEvent) {

        count--;

        if (count < 0) {

        count = imgLength;

        }

        new Tween(Slider_MC, "x", Regular.easeOut, Slider_MC.x, imagePos[count], .5, true);

        // speed = .5 value, default is set to 1

        // change easeOut to easeIn if desired

      }

      //right button press

      function buttonLeftPress(e: MouseEvent) {

        count++;

        if (count > imgLength) {

        count = 0;

        }

       

       

        new Tween(Slider_MC, "x", Regular.easeOut, Slider_MC.x, imagePos[count], .5, true);

      } * //

       

       

      Many thanks to all who can provide insight to what I need!