1 Reply Latest reply on Apr 7, 2010 5:33 AM by kglad

    alpha fade image, wait, fade out, next frame

    sherwin Level 1

      hi guys ive been experimenting with fade in fade out of a series of image using actionscript 2, now my problem is, I would like each image to fade in, image stay on the stage for 4 seconds,  fade out, and then go to the next frame and then repeat the process again and how do i make the fade in fade out more faster, hope someone can help me out, thanks so much! im currently using this code:

       

      /*
      I have two layers: 1st- Actions and 2nd-to hold the MC (I named it gallery)
      Total of 3 frames
      */


      // Frame1 in action layer
      fadeIn = "0";
      fadeOut = "100";
      setProperty("_root.gallery",_alpha, fadeIn);

      // Frame2 in action layer
      if( fadeIn != "100" )
      {
              // Start fading in the movieClip - gallery
           fadeIn++;
           setProperty("_root.gallery",_alpha,fadeIn);
      }
      if( fadeOut != "0" && fadeIn == "100" ){
         
              // Start fading out the movieClip - gallery
              fadeOut--;
              setProperty("_root.gallery",_alpha,fadeOut);
      }
      // If the frame of that movie clip has been fadeIn
      // and then faded out,
      // Go to the next frame and start the process all over again
      if( fadeOut == "0" && fadeIn == "100" ) {
          fadeOut = "100";
          fadeIn = "0";
          // Check to see if the movieClip reach the last frame
          if(_root.gallery._currentframe != _root.gallery._totalframes){
              _root.gallery.gotoAndStop(_root.gallery._currentframe+1);
          }
          // If it did reach the last frame, start from the begining
          else{
              _root.gallery.gotoAndStop(1);
          }
      }


      // Frame 3 in Action layer
      gotoAndPlay(2);