1 Reply Latest reply on Sep 28, 2009 2:43 PM by AttaBoy2

    Smooth Horizontal Image Scroller

    Marlene Level 1

      I have a series of images that merged into one 2400 pixel wide jpg. I want this to loop continuously acrooss the bottom of a website. I have tried  using TweenLite and TweenGroup but cannot get that to behave correctly. Is there an Actionscript 3 way to do this? Ultimately this is being added to a Flex site.

        • 1. Re: Smooth Horizontal Image Scroller
          AttaBoy2 Level 3
          • put the jpg on stage
          • convert it to a MovieClip
          • delete it
          • In the library right click on the MovieClip and select linkage
          • check export for actionscript and give the mc a class name
          • In your actionscript create a var yourPic:yourMCclassName as new yourMCclassName();
          • create another var yourPic2:yourMCclassName as new yourMCclassName();
          • add both pics to the stage one behind the other

          Actually it might be easyer just to look at this woking code example


          var slide1:Stretch1 = new Stretch1();
          var slide2:Stretch1 = new Stretch1();


          slide1.addEventListener(Event.ENTER_FRAME, moveIt);


          function moveIt(e:Event):void {
              this.stage.frameRate = 40;
              slide1.x --;
              slide2.x --;
              if (slide1.x <= -2400){
                 slide1.x=slide2.x + slide2.width;


              if (slide2.x <= -2400){
                 slide2.x=slide1.x + slide1.width;