8 Replies Latest reply on Jul 16, 2011 1:47 PM by panasan

    Help with Script AS 2.0

    stefsterhb007

      I have this slideshow I've done and I'm wondering why it's stopping at the last image. I need it to continuely play in a loop. Any help?

       

      holder_mc._alpha = 1;
      whichPic = 1;
      _root.onEnterFrame = function() {
      if (holder_mc._alpha>2 && fadeOut) {
      holder_mc._alpha -=2;
      }
      if (holder_mc._alpha<2) {
      loadMovie("images/"+whichPic+".jpg", "holder_mc");
      fadeOut = false;
      fadeIn = true;
      whichPic++;
      }
      if (holder_mc._alpha<100 && fadeIn && !fadeOut) {
      holder_mc._alpha +=2;
      } else {
      if (whichPic>=12) {
      } else {
      fadeOut = true;
      }
      }
      };

        • 1. Re: Help with Script AS 2.0
          kglad Adobe Community Professional & MVP

          try:

           


           

          holder_mc._alpha = 1;
          whichPic = 1;
          _root.onEnterFrame = function() {
          if (holder_mc._alpha>2 && fadeOut) {
          holder_mc._alpha -=2;
          }
          if (holder_mc._alpha<2) {
          loadMovie("images/"+whichPic+".jpg", "holder_mc");
          fadeOut = false;
          fadeIn = true;
          whichPic++;
          }
          if (holder_mc._alpha<100 && fadeIn && !fadeOut) {
          holder_mc._alpha +=2;
          } else {
          if (whichPic>=12) {

          whichPic=1;

          fadeOut=true;
          } else {
          fadeOut = true;
          }
          }
          };

          • 2. Re: Help with Script AS 2.0
            stefsterhb007 Level 1

            kglad, thank you so much. I'm looking to see what you did differently and I don't see it. My eyes must be going. Perfect!!!!!!!

            • 3. Re: Help with Script AS 2.0
              kglad Adobe Community Professional & MVP

              the changed code is in bold below:

               


               


               

              holder_mc._alpha = 1;
              whichPic = 1;
              _root.onEnterFrame = function() {
              if (holder_mc._alpha>2 && fadeOut) {
              holder_mc._alpha -=2;
              }
              if (holder_mc._alpha<2) {
              loadMovie("images/"+whichPic+".jpg", "holder_mc");
              fadeOut = false;
              fadeIn = true;
              whichPic++;
              }
              if (holder_mc._alpha<100 && fadeIn && !fadeOut) {
              holder_mc._alpha +=2;
              } else {
              if (whichPic>=12) {

              whichPic=1;

              fadeOut=true;
              } else {
              fadeOut = true;
              }
              }
              };

               

              and, if you're still able, please mark this thread as answered.

              • 4. Re: Help with Script AS 2.0
                stefsterhb007 Level 1

                Thanks. I noticed it after I sent that letter. Awesome. Thanks again.

                • 5. Re: Help with Script AS 2.0
                  kglad Adobe Community Professional & MVP

                  you're welcome.

                  • 6. Re: Help with Script AS 2.0
                    panasan

                    Hi,

                     

                    I have the following actionscript which is working fine, but I would like to wait for some seconds each image once has reached the alpha in 100, if you see the example in the header (www.vmortiz.com/index2.htm) what it does is that the image fades in and when it gets to 100 starts fading out, and I want that when it gets the alpha in 100, keep it for let's say 5 seconds and then fade it out. Could ou please help to do so?

                     

                     

                     

                    square._alpha = 0;
                    whichPic = 0;

                    _root.onEnterFrame = function() {
                    if (whichPic<4 && !fadeIn && !fadeOut) {
                    fadeOut = true;
                    whichPic++;
                    }
                    else if (whichPic>=4) {
                    whichPic = 1;
                    }
                    if (square._alpha>10 && fadeOut) {
                    square._alpha -= 2;
                    }
                    if (square._alpha<10) {
                    loadMovie("../images/banner/foto"+whichPic+".jpg", "square");
                    fadeOut = false;
                    fadeIn = true;
                    }
                    if (square._alpha<100 && fadeIn && !fadeOut) {
                    square._alpha += 5;
                    } else {
                    fadeIn = false;

                    }
                    };

                     

                    Thanks

                     

                    Regards

                    • 7. Re: Help with Script AS 2.0
                      kglad Adobe Community Professional & MVP

                      you should start your own thread with a subject title that reflects what you want.

                      • 8. Re: Help with Script AS 2.0
                        panasan Level 1

                        Sorry, I thought it should be on same thread since it was the same script.

                         

                        I'll open a new one.

                         

                        Regards,