1 Reply Latest reply on Jun 26, 2013 4:14 AM by Ned Murphy

    statment must appear within on hanlder....

    Emraan.Khan

      when i keep this code on my button in action.. "statment must appear within on handler" erro is generating.....

      what should i do for this .,, my code is....

       

       

      nxt.onRelease = function(){

       

                newthumb();

       

           }

        • 1. Re: statment must appear within on hanlder....
          Ned Murphy Adobe Community Professional & MVP

          Do not put that code on your button.  Put it in the timeline that contains the button that has an instance name of "nxt" - you can create a layer specifically for actionscript and place it there so that it is easy to find.  If you do it correctly a lowercase "a" should appear in the timeline frame where you place it.  I deally the newthumb() function should also be in that same timeline frame.

           

          In AS2 you can place code on objects but it is written differently.  Doing that is considered bad practice though because it makes code harder to find and can confuse targeting things properly.

           

          The code you show is the timeline version which is better.