4 Replies Latest reply on Oct 8, 2012 1:03 PM by SatoriDesign83

    Cant get 2 out of 3 Flash buttons to work!

    SatoriDesign83

      I have a school project and our teacher can't even figure out whats wrong. We have to make a movie/mini site for our final project and we have an intro layer/scene that stops and three buttons fade in to navigate to the respective sections (forensics, web dev, and business). The forensics button goes to the forensics page and the home button brings you back to nav page, perfect. However when I try to do the exact same commands for the other two buttons it doesn't work. Can anyone clue me in on what I am doing wrong? Its due Thursday and I am freaking out!

      Here is the file... https://dl.dropbox.com/u/9832993/final.fla

        • 1. Re: Cant get 2 out of 3 Flash buttons to work!
          Ned Murphy Adobe Community Professional & MVP

          What you should do is get the code off of the buttons and keep it all in the timeline.  Assign instance names to your buttons and use those names to assign functionality to them in the timeline. 

           

          If all of your code is kept in the same layer of your timeline then you might readily be able to see where you are going wrong.  Right now with all of the code scattered and planted on objects and whatnot, you lose sight of what you end up doing.  One clue... you need to manage your gotoAndPlay/Stop code better.

          • 2. Re: Cant get 2 out of 3 Flash buttons to work!
            SatoriDesign83 Level 1

            What do you mean by manage my gotoAndPlay/Stop code better? The only way she taught us to do it was to select the button, then go to Actions, then choose goto under Timeline functions.

             

            When you say "get the code off of the buttons and keep it all in the timeline", do you mean assign the goto function to the keyframe?

            1 person found this helpful
            • 3. Re: Cant get 2 out of 3 Flash buttons to work!
              Ned Murphy Adobe Community Professional & MVP

              Try to find all of the gotoAndWhatever commands that you use and you will find you have at least one making things go where you do not want them to go. 

               

              Putiing code on() objects such as the way you did with your buttons is bad practice.  If that is what you were taught, you are being taught bad practices. 

               

              On your buttons you are putting code like...

               

              on(release){

                  gotoAndPlay(15);

              }

               

              Instead of doing that, assign that button an instance name in the properties panel where it says <Instance Name>.  Let's say you name it "businessBtn"... if so, then in the timeline, in a layer you reserve for actionscript, you would use the following code...

               

              businessBtn.onRelease = function(){

                  gotoAndPlay(15)

              }

               

              And all the rest of your buttons' code would be there in that same frame of the timeline where you can see it all at once.  Then go collect the other tidbits of code that you have along the timeline in different layers and move it to corresponding frames of that one actionscript layer.  Now you have all your code in one layer where it is easy to find and easier to look thru to track down any problems with it.

              • 4. Re: Cant get 2 out of 3 Flash buttons to work!
                SatoriDesign83 Level 1

                Thanks, I will try that and see if it works!