1 Reply Latest reply on Sep 6, 2015 8:40 AM by kglad

    timer

    lumicon99

      hi,

      this timer script doesn't start right away, but after a while it works, what is wrong pls?

      hallo,

      ich möchte folgenden timer haben, leider startet er erst nach einer ganzen weile, dann läuft er.

      was habe ich falsch gemacht?

       

      function myTimer (){

      //trace("Hello");

      clearInterval(myTimer);

                  x = random(5);

      if (Number(x) == 0 && m != 1) {

          loadMovieNum("01.swf", 2);

          loadMovieNum("flash.swf", 3);

          m = 1;

          //gotoAndPlay("Scene2", 1);

      } else if (Number(x) == 1 && m  != 2){

          loadMovieNum("02.swf", 2);

          loadMovieNum("flash.swf", 3);

          //gotoAndPlay("Scene2", 1);

          m = 2;

      } else if (Number(x) == 2 && m  != 3) {

          loadMovieNum("03.swf", 2);

          loadMovieNum("flash.swf", 3);

          //gotoAndPlay("Scene2", 1);

          m = 3;

      } else if (Number(x) == 3 && m  != 4) {

          loadMovieNum("04.swf", 2);

          loadMovieNum("flash.swf", 3);

          //gotoAndPlay("Scene2", 1);

          m = 4;

      } else if (Number(x) == 4 && m  != 5) {

          loadMovieNum("05.swf", 2);

          loadMovieNum("flash.swf", 3);

          //gotoAndPlay("Scene2", 1);

          m = 5;

      }

      }

        • 1. Re: timer
          kglad Adobe Community Professional & MVP

          1.  myTimer is defined as a function

          2.  there's a clearInterval in myTimer that makes no sense, at all, under any circumstance.

          3.  there's no timer script shown anywhere.

           

          bottomline:  i  suspect there's actually something really screwy going on like:

           

          myTimer=setInterval(myTimer,whatever);  // <--which is very wrong/cringe inducing.