1 Reply Latest reply on May 6, 2015 3:36 AM by owen_bayley

    Idle Timeout Code

    evana45602007

      I am hoping to get help with an idle timeout code.  I am creating a short photo book using Adobe Edge Animate and if someone is on Page 3 for longer than lets say 1 minute without clicking to the next page I want to return the the cover image.  As a test I have set the stage for 5 seconds to set an alert if not clicked and its works great!  Unfortunately, this was just a test and I wanted to replace the alert with symbols (the cover image)  but it hasn't worked at all.  Help would be appreciated!

       

      Stage Code

      var r;

      var timer;

       

      function doIt() {

        r = confirm ("hello");

        if (r == true) {

        setIt();

        } else {

        //screen saver

        alert("bye!");}};

       

      function setIt() {

        timer = setTimeout(doIt, 5000);};

       

      Stage.Click Code:

       

      clearTimeout(timer);

           setIt();

        • 1. Re: Idle Timeout Code
          owen_bayley Level 1

          hey evanam,

           

          I'm not sure how you have layer out your project but this might work but you could try :

           

          var r;

          var timer;

           

          function doIt() {

            r = confirm ("hello");

            if (r == true) {

            setIt();

            } else {

          sym.getComposition().getStage().$("cover").show();

          }};

           

          function setIt() {

            timer = setTimeout(doIt, 60000);};

           

          Stage.Click Code:

           

          clearTimeout(timer);

               setIt();

           

          All I have done is extended the timer to 60 seconds and edited the else so if you are in a symbol you can go to the main stage and show the element of cover.

           

          hope this helps (if not any example of the project would help)

           

          Owen