2 Replies Latest reply on Dec 27, 2015 8:25 PM by baraa abd el-hady

    CreateJS gotoAndPlay Question

    Gtar

      I'm currently trying to get the Start button to trigger a replay of the animation but I just can't seem to figure the problem out. I tried including the code in both the flash-file and the .js that was created but nothing seems to work. I tried adding an onClick and labels to the frames instead of numbers but those don't work either. I'm able to press the button but nothing happens. Project: http://www.mediafire.com/?a9x7qf5dq3x8xyc

        • 1. Re: CreateJS gotoAndPlay Question
          ron700

          Tri.fla is missing the necessary javascript code. The Toolkit does not translate actionscript into javascript (it completely ignores actionscript).

           

          (To make it work:

          1. Give the start-button an instance name: btn1

          2. Replace the code in frame 1 with:

          /* js
          // This is javascript. The toolkit recognizes /* js
          var _this = this;
          this.stop();
          this.btn1.onPress = function()
          {
               _this.gotoAndPlay(0); // 0 not 1
          }
          // End of javascript
          */
          var _this = this;
          this.stop();
          btn1.onPress = function()
          {
               _this.gotoAndPlay(1);
          }
          

          3. Replace the code in the last frame with:

          /* js
          this.stop();
          */
          this.stop();
          

          )

          1 person found this helpful
          • 2. Re: CreateJS gotoAndPlay Question
            baraa abd el-hady

            can you ron700 put a working fla file with the code of gotoandplay