3 Replies Latest reply on Jan 5, 2007 9:48 PM by arunbe

    Need Help with Pause and Play Function

    Time Indicator Level 1
      HI,

      I have a pause/play button in my fla. The problem that I am having is that it does not pause the animation on the root timeline. However, pause and play is working fine for event based sound. I am not sure where the problem is occurring. I even tried stopping all the functions of the movie clip, but it doesn't seem to work. Can someone please help me with this.

      Here is the code that I have on a dual pause/play button:

      I have this code on on the pause function:

      on (press) {
      tellTarget("_root") {
      stop();
      stopAllSounds();
      soundposition= my_sounds.position;
      my_sounds.stop();
      _root.intro.stop();
      _root.run.stop();
      _root.walk.stop();
      this.gotoAndStop("play");
      }
      }


      I have this code on the play function:

      on (press) {
      tellTarget("_root") {
      play();
      var secondOffset = soundpos
      var sec = secondOffset/1000
      my_sounds.start(sec,1);
      _root.intro.play();
      _root.run.play();
      _root.walk.play();
      this.gotoAndStop("pause");
      }
      }


      Thanks.
        • 1. Re: Need Help with Pause and Play Function
          arunbe Level 1
          I guess there is no problem in your code.
          you try out "with( )" instead of "tellTarget ( )"... ???
          • 2. Re: Need Help with Pause and Play Function
            Time Indicator Level 1
            Hey Arun,

            I just wanted to tell you that the pause function stops the animation that is on the main timeline. However, it is not pausing the animation within the timeline. In other words, the movieclip on the main timeline pauses however the movieclip within the movieclip is the issue. It is not pausing. I have small movieclips inside the main movieclip and none seems to stop. I just want to know whether you will be able to help me out on that. Thanks.
            • 3. Re: Need Help with Pause and Play Function
              arunbe Level 1
              Look,
              If you are using a movie clip "main_mc" in the time line and
              there are three movie clips in side that movice clip namely,
              submc_1, submc_2, submc_3.
              Now you are having a button in the main time line with the name my_btn.
              Now what you have to do to stop the animation of main_mc and its submc's is
              my_btn.onRelease = function()
              {
              _root.main_mc.stop();
              _root.main_mc.submc_1.stop();
              _root.main_mc.submc_2.stop();
              _root.main_mc.submc_2.stop();
              }
              Like this, you have to stop all the clips inside the main movie clip....
              Hope you can understand.....