5 Replies Latest reply on Nov 1, 2012 5:08 AM by Ned Murphy

    How to Loop Caurina Tween animation

    Kyle Hawkins Level 1

      I have built an animation with the tween engine Caurina in AS2. I now need to make the whole file loop when the last mc is played.

      Can someone tell me how to do this please?

       

      The file is not timeline based and is a series of mcs placed on the stage.

       

       

      Thanks!

        • 1. Re: How to Loop Caurina Tween animation
          Ned Murphy Adobe Community Professional & MVP

          I think the Tweener class should have an onComplete parameter that you can specify to call a function when the tween completes.  You should be able to use that to get things to start over.  If your animation is not timeline based, then you are currently the only one who knows what's involved with getting it started again.

          2 people found this helpful
          • 2. Re: How to Loop Caurina Tween animation
            Kyle Hawkins Level 1

            Sorry, I should have posted the code.

            This is a cut down version of it to show you the structure.

             

            // Import Filters

            import flash.filters.*;

            // Import Tweener

            import caurina.transitions.Tweener;

            // Import Tweener propertie shortcuts

            import caurina.transitions.properties.FilterShortcuts;

            // *** Very Importaint *** : Initialize shortcuts

            FilterShortcuts.init();

             

             

            product_mc._alpha = 0;

            cta_mc._alpha = 0;

            cta2_mc._alpha = 0;

            logo_mc._alpha = 0;

            terms._alpha = 0;

            tc2._alpha = 0;

             

             

            sub_copy1._alpha = 0;

            sub_copy2._alpha = 0;

            sub_copy3._alpha = 0;

            sub_copy4._alpha = 0;

             

             

            // frame1

             

             

            var glowIn:GlowFilter = new GlowFilter(0xC7C8CF,1,10,10,3,3);

            var glowOut:GlowFilter = new GlowFilter(0xC7C8CF,0,10,10,3,3);

             

             

            caurina.transitions.Tweener.addTween(product_mc, {_alpha: 100, _x: -69, time: 2, delay: 0, transition: "easeOutCubic"});

            caurina.transitions.Tweener.addTween(logo_mc, {_alpha: 100, _blur_blurX: 10, time: 1.5, delay: 0.5, transition: "easeOutCubic"});

            caurina.transitions.Tweener.addTween(sub_copy1, {_alpha: 100, _blur_blurX: 10, time: 1.5, delay: 2.5, transition: "easeOutCubic"});

            caurina.transitions.Tweener.addTween(sub_copy1, {_alpha: 0, _blur_blurX: 10, time: 1.5, delay: 9.5, transition: "easeOutCubic"});

            caurina.transitions.Tweener.addTween(sub_copy2, {_alpha: 100, _blur_blurX: 10, time: 1.5, delay: 3.5, transition: "easeOutCubic"});

             

             

            caurina.transitions.Tweener.addTween(terms, {_alpha: 100, _blur_blurX: 10, time: 1.5, delay: 5.5, transition: "easeOutCubic"});

            caurina.transitions.Tweener.addTween(cta_mc, {_alpha: 100, _blur_blurX: 10, time: 1.5, delay: 4.5, transition: "easeOutCubic"});

            caurina.transitions.Tweener.addTween(sub_copy2, {_alpha: 0, _blur_blurX: 10, time: 1.5, delay: 9.5, transition: "easeOutCubic"});

            caurina.transitions.Tweener.addTween(terms, {_alpha: 0, _blur_blurX: 10, time: 1.5, delay: 9.5, transition: "easeOutCubic"});

             

             

            caurina.transitions.Tweener.addTween(sub_copy4, {_alpha: 100, _blur_blurX: 10, time: 1.5, delay: 10, transition: "easeOutCubic"});

            caurina.transitions.Tweener.addTween(tc2, {_alpha: 100, _blur_blurX: 10, time: 1.5, delay: 11, transition: "easeOutCubic"});

            • 3. Re: How to Loop Caurina Tween animation
              Ned Murphy Adobe Community Professional & MVP

              If your intention is to continuously re-execute the same series of tweens, then you should place them into a function and have something to call that function each time you need to start it up again.  I already mentioned you should be able to have an onComplete parameterin whichever tween is last which could take care of calling that function for all but the first time in needs to be called.

              1 person found this helpful
              • 4. Re: How to Loop Caurina Tween animation
                Kyle Hawkins Level 1

                I have taken what you mention as regards the onComplete parameterin and implemented this accordingly. It now works.

                Thanks as ever for your help, greatly appreciated.