5 Replies Latest reply on Jan 30, 2008 7:48 PM by kglad

    Cross fading alpha channels

    bhuber7
      Hi everyone. I'm really in a bind here. I've been working on this for two days now and I'm ready to pull my hair out. I'm making a slideshow that cycles through x amount of images from an XML file. The images change every 6 seconds. The image can also change forward or backward via a Next and Previous button.

      That all works fine. My problem comes in with the transition from image to image. As of now, the new image's alpha fades in from 0 to 100. What I want is for the old image's alpha to fade from 100 to 0 at the same time - a cross fade. No matter what I've tried, I can't get the old image's alpha to fade out.

      Can anyone help out? It would be MUCH appreciated!
        • 1. Re: Cross fading alpha channels
          kglad Adobe Community Professional & MVP
          i didn't get past that _alpha incrementing firstImage() function because you have a substantial problem there: your stop() isn't going to terminate that loop which means you picture is going to have a very large alpha by the time.

          also, i don't see two (or more target movieclips) into which you load your images. there's no way to cross-fade unless you have, at least, two target movieclips. in fact, you can't display both at the same time with only one target movieclip.
          • 2. Re: Cross fading alpha channels
            bhuber7 Level 1
            Thanks for the reply kglad. I put a second movie clip in underneath the current one. I have that movie clip loading the previous image so when the new image fades in, it looks like it's fading over the old one.

            The problem with this is that there's a brief period of white between the images - I'm guessing because the other image hasn't been loaded yet.

            How can I preload the previous image so that it's ready to display as soon as the image changes?
            • 3. Re: Cross fading alpha channels
              kglad Adobe Community Professional & MVP
              use preloader code or the onLoadInit() method of a listener for a moviecliploader instance to preload your image and ensure you're ready to start your cross-fade.
              • 4. Re: Cross fading alpha channels
                bhuber7 Level 1
                Thanks for your help kglad. I was able to get the images to cross fade nicely. I have additional issues with dynamic text cross fading, but I will start a new thread for that one. Thanks again!
                • 5. Re: Cross fading alpha channels
                  kglad Adobe Community Professional & MVP
                  you're welcome.

                  for dynamic text, you need to embed your font if you want to control its _alpha.