2 Replies Latest reply on Apr 10, 2007 8:01 AM by Comp. 792-YeIbLU

    Slideshow with Fading Images

    Comp. 792-YeIbLU Level 1
      Is there a tutorial around on creating a slideshow with fading images. I want to drop my images into a folder. 01.jpg, 02.jpg etc. and then have an actionscript automatically fade them in and out.

      Does someone know how to do this dynamically. I know it can be done. I want all of the .jpg images to reside in a folder and then I want the images to load and play automatically using an .XML file.

      Thanks
        • 1. Re: Slideshow with Fading Images
          Dewdan
          I would do it with this code:
          on frame 1:

          //---------------------------------------------------------------------------------------- --
          mc = function() {
          num = (Math.round(Math.random()*27));
          //----------------------------------------- 27 being the number of images i have (name them from 0.jpg to 26.jpg
          totalfilename = num + ".jpg";
          _root.picLoader.loadMovie(" http://www.yoursite/yourimageFolder/" + totalfilename);
          //----------------------------------------picLoader being my empty movie clip where the pictures are loaded
          }
          mc();
          clearInterval(mc.intID);
          mc.intID = setInterval(mc, 20000);
          // ----------------------------------------------- every 20 sec the picture will change randomly
          //--------------------------------------------------------------------
          then on the emptyMovieClip ad this code:
          --------------------------------------------------------
          // this will fade the image in
          onClipEvent (load)
          {
          this._alpha = 0;
          }

          onClipEvent (enterFrame)
          {
          if (this._alpha < 100)
          {
          this._alpha = this._alpha + 5;
          } // end if
          if (this._alpha >= 100)
          {
          this._alpha = 100;
          } // end if
          }
          ________________________________________________

          I hop this helped
          • 2. Re: Slideshow with Fading Images
            Comp. 792-YeIbLU Level 1
            Txarán,

            Thanks for that. Could you offer advice on how to use it?

            Thanks