4 Replies Latest reply on Jul 26, 2011 12:23 PM by kglad

    Image faid in/out

    Desmond666

      Hi I am new to flash but have created a powerpoint stly presentation of images. I Have a Movie Clip on the stage. Is it possible to get a fade in/out effect on the images. The actual work horse here is actionscript file that uses the following

       

              function imageLoaded(e:Event):void
              {
                  imageArea.addChild(imageLoader);
              }

       

      Where imageArea is the reference to the Movie Clip.

       

       

      Thanks

       

      Desmond.

        • 1. Re: Image faid in/out
          kglad Adobe Community Professional & MVP

          you can use something like:

           

          var t:Timer=new Timer(70,0);
          t.addEventListener(TimerEvent.TIMER,f);
          imageLoader.alpha=0;

                  function imageLoaded(e:Event):void
                  {
                      imageArea.addChild(imageLoader);

          t.start();
                  }

           

          function f(e:TimerEvent):void{

          imageLoader.alpha+=.04;

          if(imageLoader.alpha>=1){

          t.stop();

          // remove listener and null t if not needed again.

          imageLoader.alpha=1;

          }

          }


          • 2. Re: Image faid in/out
            Desmond666 Level 1

            Hi Thanks for that. I already have a timer that goes through a loop getting the next image for the MovieClip on the Flash stage. I have seen some websites where one image slowly faids out and another faids in. Is this done as a repeat movie or is this something I can do with a series of images in a folder.

             

            I have the complete CS5.5

             

             

            Desmond.

             

             

            Another thought. If I have two movieClips on the stage and two imageLoders could I alternate between them have an alpha faid out on one and a faid in on the other. Would this be a solution ?????

            • 3. Re: Image faid in/out
              kglad Adobe Community Professional & MVP

              for a cross-fade, you need at least 2 loaders so you can fade one in while fading the other out.

              • 4. Re: Image faid in/out
                Desmond666 Level 1

                Thanks I added that to my query as a possible solution. two MovieClips, two

                Loaders and to variables for the alpha values crossing over on a short

                timer  event. Wasn't sure if having two MovieClips on a stage with one behind

                the other  it would show through?

                 

                Desmond 

                 

                 

                In a message dated 26/07/2011 20:24:32 GMT Daylight Time, forums@adobe.com 

                writes:

                 

                for a  cross-fade, you need at least 2 loaders so you can fade one in while

                fading  the other  out.