7 Replies Latest reply on Mar 26, 2012 9:33 AM by kglad

    Action Script 2 buttons

    rwhitner90 Level 1

      I am trying to make my buttons work but it's just not happening.

       

      I have a page that has 6 buttons on it, when you click a button it is supposed to go to another part of the timeline and play those certain frames. I have code inserted on an actions layer on the frames that are supposed to play corespoinding each button.

       

      Before the frame I have

      stop();

      _root.flag_animation1 = 1;

       

      The frame label is M1

       

      and after the frame I have the code

      gotoAndPlay("s" + _root.link);

       

      On the button I have the code

      on (rollOver)

      {

          if (_root.link != 1)

          {

              this.gotoAndPlay("s1");

         

      }

       

      on (release)

      {

           (0 != (_root.link != 1) & 0 != (_root.flag_animation1 == 1))

          {

              _root.flag_animation1 = 0;

              _root.menu["item" + _root.link].gotoAndPlay("s2");

              1;

              _root.link_prev = _root.link;

              _root.link = 1;

              _root.scrollPART.gotoAndStop(2);

              _root.scroller.scroller.gotoAndStop(3);

              _root.play();

          }

       

       

       

      I obviously have no idea how to change the code to do what I want so if you have any idea what i'm talking about it would be great. Thanks!

        • 1. Re: Action Script 2 buttons
          kglad Adobe Community Professional & MVP

          that code is terrible.  i recognize the _root.link as coding from templates (with terrible coding) sold on the internet.

           

          but if that's your original coding it's salvageable.  start by removing all code from objects and add code to your timeline.

          • 2. Re: Action Script 2 buttons
            rwhitner90 Level 1

            Hahaha, it is from a template (which all the coding from the template I have deleted and re-written) This part of the code I'm having a tough time with though (trying to work off what they gave me)

             

            The only code attatched to objects is the code attatched to the button itself. Say I delete all of this code, what do I need to put in it's place and where?

            • 3. Re: Action Script 2 buttons
              kglad Adobe Community Professional & MVP

              if it's from a template you have a difficult job.  the coding is so bad with code attached to almost every timeline in the swf that it's harder to salvage that code than it is to completely redo it.

               

              or just try and edit it to change whatever you want to change. 

               

              are you trying to add a new button to that template or trying to change the code on a button that was working before?

              • 4. Re: Action Script 2 buttons
                rwhitner90 Level 1

                The template has been completely redone. The only code that exsist is the code I entered myself ( therefore it is all on one actions layer in the main timeline) So i am trying to create a new button..the only buttons they have are on the menu bar, so when you click them they go to a certain place on the timeline and play those frames. What i'm trying to do is after you click one of those buttons it brings you to a certain frame (this works) this "page" has 6 other buttons that need to go to corresponding frames. I hope this makes sense.

                • 5. Re: Action Script 2 buttons
                  kglad Adobe Community Professional & MVP

                  1.  if all the code is on the main timeline, why did you show the code in your 1st message.

                  2.  if you have the original buttons coded correctly with timeline code, why don't you use similar code for your 6 new buttons?

                  • 6. Re: Action Script 2 buttons
                    rwhitner90 Level 1

                    I guess i'm not explaining this very well. The code is all in the main timeline, the code for the buttons is on the buttons. The code i posted is the code I made work for the other buttons but I can not get it to work for these buttons. Maybe I am confused on what I need to change etc

                    • 7. Re: Action Script 2 buttons
                      kglad Adobe Community Professional & MVP

                      you may not understand that template well-enough to get forum help.

                       

                      someone familiar with your template or someone willing to download and fix your files for you will be needed.