7 Replies Latest reply on Aug 12, 2009 1:12 PM by kglad

    how to stop small animation

    Levsky

           Hi

      I guess I did not finish my project yet

       

      Ok here is is

      I have a script that will stop sound on click of the mouse, but I have a little animation running  but I need to stop it with the same click of the mouse ( together  with the sound)

      just insert stop()  stop entire project and this is not good,  this is a loader and it need to have ability to continue even some one shut sound of.

       

      I apprecate any help

       

      Thanx

       

       

      Lev

        • 1. Re: how to stop small animation
          kglad Adobe Community Professional & MVP

          is your "little animation" a movieclip?  if yes, assign it an instance name and apply a stop() to it.  if no, convert it to a movieclip, assign an instance name and apply a stop() to it.

          • 2. Re: how to stop small animation
            Levsky

            Thanx

             

            Why did i thougjt of this?

             

            It work like a charm

             

             

            Lev

            • 3. Re: how to stop small animation
              kglad Adobe Community Professional & MVP

              you're welcome.

              • 4. Re: how to stop small animation
                Levsky

                Hi

                IAhte to be a pest

                I thought that u where correct and i know what to do, so I finaly got to the script and unless I am doins somthing worng iot do not working as expected

                 

                He is a script

                 

                 

                mySound = new Sound();
                mySound.attachSound("destination.mp3");
                sound_btn.onRelease = function() {
                mySound.stop();---------------------------------------------//--this stops the sound
                }
                anim_mc.onRelease = function() {
                gotoAndStop("sound_anim"); --------------------------// this supouse to stop animation  in this way it do not  sound_anim is the name of the layer
                }

                ///  I did try to go this way ----     anmi_mc.onRelease = stop()      //-   but this stop entire animation  

                 

                What did I did wrong?

                Thanx

                 

                Lev

                • 5. Re: how to stop small animation
                  kglad Adobe Community Professional & MVP

                  assign your animation movieclip an instance name, say animMC.  you can then use:

                   

                  animMC.stop();   // to stop the animation

                   

                  animMC.play();  // to continue the animation from where it was stopped.

                  • 6. Re: how to stop small animation
                    Levsky

                    Hi

                    Thank you for trying to help

                    anim_mc is the instance movie not a button

                     

                    I try  anim_mc.close()

                    I get no respons for animation

                     

                    I had try to do it this way as a part of the second script

                     

                     

                     

                     

                    mySound = new Sound();
                    mySound.attachSound("destination.mp3");
                    sound_btn.onRelease = function() {
                    mySound.stop();

                      anim_mc.close();
                    }

                     

                    and try this way too

                     

                    anim_mc.onRelease = function() {

                    ainm_mc.stop()

                    }

                     

                    As u suggested

                     

                    I had try to insert  directly not using script layer

                     

                    It seem do not work

                     

                    Any idea why, or  look i am  designed  and action script still very difficult for me and i can read until god know what  i lern much fester when some on point you to a right place and then u remember....

                     

                    any way  thanx for your help

                     

                    Lev

                    • 7. Re: how to stop small animation
                      kglad Adobe Community Professional & MVP

                      you're welcome.