3 Replies Latest reply on Jun 14, 2013 7:16 AM by Ned Murphy

    on release

    Emraan.Khan

      My script is not working from within a movie clip.... what should i do for this please help me...

      my script is--

       

      on(release){

          gotoAndPlay(5);

       

      }

        • 1. Re: on release
          Ned Murphy Adobe Community Professional & MVP

          What is the script supposed to be doing that it is not doing - which timeline is supposed to go to frame 5 and play?

           

          You should avoid placing code "on" objects and put it in the timeline instead.  The timeline version of the code would be...

           

          objectName.onRelease = function(){

                gotoAndPlay(5);

          }

           

          where objectName is replaced with the instance name of whatever object is being clicked.

          • 2. Re: on release
            Emraan.Khan Level 1

            "statement must appear within on handler" error occurs

            • 3. Re: on release
              Ned Murphy Adobe Community Professional & MVP

              That indicates you are trying to place the code on the object.  The code I provided goes in the timeline where it is easier to find.  Select the frame in the timeline and enter the code in the Actions panel.

               

              You should answer the questions I asked in case the code needs adjusting anyways.