2 Replies Latest reply on Jun 8, 2009 3:13 PM by Tiffany Eubanks

    How to insert animation before and after this animation template??

    Tiffany Eubanks

      I'm using the file from the online template below, but am going to replace the flag with a man's tie that's going to be "flapping in the wind" momentarily.

       

      BUT I need to add a small amount of animation before this "flapping" animation begins, as well as after it, and I only want the flapping to last about 1.5 seconds or so - not continually looping.

       

      http://www.senocular.com/flash/source.php?id=0.188

       

      I don't know how to even begin to add the animation I need before/after, and to edit the time down on the looping. Any help is GREATLY appreciated!!

        • 1. Re: How to insert animation before and after this animation template??
          kglad Adobe Community Professional & MVP

          change the flag to your tie and change the onEnterFrame loop:

           

          use

           

          loopI = setInterval(loopF,40);

           

          to start the waving and use:

           

          clearInterval(loopI);

           

          to stop the waving.

           

          function loopF(){
             
              // move the matrix by speed along x to shift the noise
              shift.translate(speed, 0);
             
              // drawing in the perlin movie clip,
              // create a rectangle with the perlin noise
              // drawn in it with an offset supplied by the
              // shift matrix
              with (displace_mc.perlin){
                  clear();
                  beginBitmapFill(noiseBitmap, shift);
                  moveTo(0,0);
                  lineTo(ramp._width, 0);
                  lineTo(ramp._width, ramp._height);
                  lineTo(0, ramp._height);
                  lineTo(0, 0);
                  endFill();
              }
             
              // draw the displacement movie clip in the
              // displaceBitmap (used in displaceFilter)
              displaceBitmap.draw(displace_mc);
              // apply displaceFilter to the flag
              flag_mc.filters = [displaceFilter];

          updateAfterEvent();
          }

          • 2. Re: How to insert animation before and after this animation template??
            Tiffany Eubanks Level 1

            Thanks! Where do I need to place the :

             

            loopI = setInterval(loopF,40);

             

            and

             

            clearInterval(loopI);

             

            for starting / stopping? In the same panel as all the other code, on the timeline, or where?