3 Replies Latest reply on Dec 10, 2007 11:27 PM by MYAE2

    Fade Movieclip

    MYAE2
      Hi,

      Please help me to have control over the speed of the fades and transitions between photos in my phot gallery.
      My action script so far looks like this:

      Thank you
        • 1. Fade Movieclip
          dwkd Level 1
          as far as having control over fade ins you just work with

          if (picture._alpha<100)
          {
          picture._alpha += 10;
          }
          if you want it slower replace picture._alpha += 10; with picture._alpha += 1;
          the slowest would be increments of 1 since alpha ranges from 1 to 100

          i don`t know about transitions
          from what i can see you are using previous and next buttons ( transition should be instant on pressing )
          if you want it to fade out it probably have to look like this

          function nextImage() {
          if (p<(total-1)) {
          for (var t=0; t<10; t++)
          {
          picture._alpha -= 10;
          }
          p++;
          if (loaded == filesize) {
          picture._alpha = 0;
          picture.loadMovie(image[p], 1);
          desc_txt.text = description[p];
          picture_num();
          }
          }
          }
          EXPLAIN :

          for (var t=0; t<10; t++)
          {
          picture._alpha -= 10;
          }
          this will loop 9 times decreasing the alpha of the photo 10 percent at a time
          so that makes it 90% decreased and then 2 lines down you`ll have picture._alpha = 0 ; which makes it the 10th time so the photo should be gone

          I really appologize if i have mistaken .. i didn`t actually try what i wrote but i makes sense to me :))

          • 2. Re: Fade Movieclip
            dwkd Level 1
            btw this kinda looks like a kirupa tutorial :P
            no harm .. just wanted to say it's a good site
            • 3. Re: Fade Movieclip
              MYAE2 Level 1
              Thanks, but this does not work. I need a code which can adjust the length of the fade. For example, if I want the first image to fade in for 1, 2, or 3 seconds, etc.
              Yes, kirupa.com is a fabulous site.