3 Replies Latest reply on Jul 30, 2008 2:10 PM by TALAL MANAA

    Stop à panoramic after 20 sec

      I generate a 360 view with this code :

      The animation always turn around, and I'd like to stop it after 30 sec.
      Someone can help me ?
      I try to use setInterval and clearInterval, but surely badly...

        • 1. Stop à panoramic after 20 sec
          TALAL MANAA Level 1
          Define a function to stop your onEnterFrame after 30 second.
          function stopMyAnimation() {
          delete this.onEnterFrame;
          // you can also remove the "this." if you are in the root
          //now you have to clear the interval that we'll create shortly;
          //Now we set an Interval with it's id (t1) to execute after 30 sec to stop your animation after deleting your onEnterFrame;
          t1 = setInterval(stopMyAnimation,30000);
          //where 30000 = 30 sec.
          //hope this works with you

          • 2. Re: Stop à panoramic after 20 sec
            Mybarbara Level 1
            Thanks it's almost perfect.
            The fact is i'd like the movie restart at his position if the mouse go rigth or left on the movie

            An idea ?

            But thanks thanks thanks
            • 3. Stop à panoramic after 20 sec
              TALAL MANAA Level 1
              try adding Mouse Listener Object in combination with a function we define for your animation so that when your mouse moves right or left, your animation starts, and if your mouse stops the animation should.
              var mymouseListener:Object = new Object();
              mymouse.onMouseMove = function():Void {
              if (_xmouse ++ || _xmouse --) {
              //your animation goes here
              } else {
              //stop your animation, or clear your interval of a function as previously mentioned.