3 Replies Latest reply on May 29, 2009 4:15 AM by Ned Murphy

    Button and actionscripting 2.0 problem

    fixm

      I'm working with some high school students on a tutorial in CS3 (professional) that has worked in all previous versions of Flash.  We have created a button with up, down, hit states and sound.  We placed the button on a movie clip (7 frames in length) and try to apply actionscripting (2.0) to the button but the action scripting pane does not allow us to apply any scripting (we can't apply any version of action scripting).  We have made sure only the button is selected, no luck.  When we select the frames in the movieclip timeline we are allowed to add scripting. Problem with this is there are multiple buttons on the movie clip.  We have given the button instance a unique name (backButton) and made sure it was a button and it is tracked as a button. I have no idea what else to try...please help me so I can help these students. thanks

        • 1. Re: Button and actionscripting 2.0 problem
          Ned Murphy Adobe Community Professional & MVP

          Chances are your Publish Settings are set for Actionscript 3.  If you change the setting to Actionscript 2 you will be able to code the button(s) as you have in the past.

           

          But you may want to reconsider how you teach this aspect of actionscripting because coding on objects is not a recommended practice.  Not only does it make code harder to find, but AS3 did away with allowing it... In AS3 all code must go on a timeline.  If you were to teach AS2 as timeline programming, students would be better prepared for stepping up to AS3.

           

          You can also code on the timeline in AS2 via the instance name that you assign in the properties panel.

           

          button1.onRelease = function(){

               // code

          }

           

          is the equivalent of putting the following directly on the button...

           

          on(release){

               // code

          }

           

          The primary benefit of using the timeline is that all of the code can be visible in the timeline frames.  There's no need to fish around for code hiding on objects.

          • 2. Re: Button and actionscripting 2.0 problem
            fixm Level 1

            Thank you for this help.  This solved the problem.

            • 3. Re: Button and actionscripting 2.0 problem
              Ned Murphy Adobe Community Professional & MVP

              You're welcome.