2 Replies Latest reply on Jul 24, 2006 6:26 AM by Nickels55

    please help with timout code. I'm under deadline.

    flashfloozie Level 1
      I have a timeline that stops on a frame full of flv playback components. I need the frame to listen for mouse clicks and after no mouse clicks for 2-3 minutes I need it to gotoAndPlay frame 1. As long as the viewer keeps clicking on the video controls it need to keep reseting the timer.

      I have looked all over trying to find something on this and got some help from the as forum but it's not woking like I need it to. I'm hoping to have this ready for a tradeshow in a couple of days.

      Any help would be greatly appreciated.

      ff
        • 1. Re: please help with timout code. I'm under deadline.
          flashfloozie Level 1
          I've added this code on the video page frame and it works but I need to disable it after the goto frame 1 or else it just meets the criteria for the goto again as soon as it loops around and gets back to the video page frame and just goes back to frame 1 without showing the video page frame without the 120 sec check for mouse movement.

          How do I disable this code on frame one and then let it work again when the timeline gets to the video page frame again.

          t=120; // 120 seconds inactivity triggers return to frame 1
          clearInterval(inactiveI); // <-- new statement
          inactiveI=setInterval(inactiveF,1000*t);
          function inactiveF(){
          _root.gotoAndPlay(1);
          }
          _root.onMouseMove=function(){
          clearInterval(inactiveI);
          inactiveI=setInterval(inactiveF,1000*t);
          • 2. please help with timout code. I'm under deadline.
            Nickels55 Level 2
            I can give you theory although the code may be a little off:

            onEnterFrame = function(){
            whereami = _root._currentframe
            }

            if (whereami=="1")
            {
            //do nothing
            }else{
            t=120; // 120 seconds inactivity triggers return to frame 1
            clearInterval(inactiveI); // <-- new statement
            inactiveI=setInterval(inactiveF,1000*t);
            function inactiveF(){
            _root.gotoAndPlay(1);
            }
            _root.onMouseMove=function(){
            clearInterval(inactiveI);
            inactiveI=setInterval(inactiveF,1000*t);
            }


            Something like that should work, but he code may need a little adjusting. It is basically looking at what frame the movie is at, and doing nothing if it is in frame 1.