5 Replies Latest reply on Sep 3, 2016 6:42 AM by krzysztof.rog

    Animate - problem with duplicating scripts after loop

    krzysztof.rog Level 1

      Hi All,

       

      I have a problem with simple button script at first frame. Everything is fine when timeline is playing for first time. After that when timeline loops and stop again at 0 frame button script is fireing two times, when it loops third time it is fireing three times etc...

       

      Here is my script:

       

      this.stop();

      exportRoot.mc_cta.cursor = "pointer";

       

      this.mc_cta.on("click", clickFunc.bind(this));

       

      function clickFunc() {

          console.log("clicked");

          EB.userActionCounter("clicked");

          exportRoot.gotoAndPlay(1);

      }

       

      Anybody any ideas? Where Am I wrong?

       

      Thanks!

      Kris