5 Replies Latest reply: Apr 4, 2011 4:25 PM by kglad RSS

    AS 2 for infinite slide show loop

    ruthgordy Community Member

      I don't know if there is a simple answer to my question. Here goes.  I created an infinitely looping series of photos that scrolls from right to left. The animation was created with 6 photos and was animated using AS 3.

      Is there substitute coding using AS 2 in place of my AS 3 coding?

      Or is it more complicated and does it depend on how the photos were set up in my document, how the photos and groups of photos were converted to symbols etc??

       

      here is my current AS 3 code that works.

       

      var centerX:Number = stage.stageWidth / 2;

      var galleryWidth:Number = infiniteGallery.width;

      var speed:Number = 0;

      addEventListener(Event.ENTER_FRAME, moveGallery);

       

      function moveGallery(e:Event):void {

      speed = -(0.02 * (mouseX - centerX));

      infiniteGallery.x+=speed;

      if (infiniteGallery.x>0) {

      infiniteGallery.x= (-galleryWidth/2);

      }

      if (infiniteGallery.x<(-galleryWidth/2)) {

      infiniteGallery.x=0;

      }

       

      }

       

      I'm not a coding guru and find my AS stuff through blogs and tutorials and need to be led by the hand.

      Thanks!