3 Replies Latest reply on Apr 29, 2012 3:10 AM by Matt Belshaw

    I can't get buttons to work correctly!


      Ok here is my problem...


      I am trying to make my cousins website and everything looks ok. Nothing to fancy since it is the first time I am working with flash. But now I am trying to get the buttons working. Here is the website to follow what I am going to ask: www.andrelenza.com.br


      Ok so there is a main menu (Home, Projetos, Bio, Imprensa, and Contato) and there are submenus. I am trying to get the main menu buttons working during the WHOLE site. I don't want them to ever change. I have found a way to do this which is by putting the code snippet "Click to Go to Frame and Play". But I have to redo each button ALL the time and it ends up being a lot of repeated code. I am sure there is a simple way to do this but I have really tried everything and I still haven't found out how to do it.


      I tried making another actions layer, one for the stops and the other one I was going to make all the code for the buttons in the first frame and let it go on the whole time. But that didn't work, when I publish it, the movie doesn't even start. Which I don't get why since there is no Stop at the beginning.


      If anyone could help it would be great. I really want to learn how to work with flash.


      If you need I also have the .fla ready to be downloaded so that you can have a look at what I have done.


      Thanks in advance,


        • 1. Re: I can't get buttons to work correctly!
          Matt Belshaw

          have you defined the buttons in frame 1 and got those buttons active on the timeline from start to finish?

          • 2. Re: I can't get buttons to work correctly!
            MrPlumber21 Level 1

            When I tried putting the code in the first frame and tried getting it on the whole movie it didn't work. I use stops a lot and whenever I used it, it would make the code for the buttons go away. That's when the code became HUGE. After every stop I would have to write new code for all the buttons again.


            And when I tried make 2 action layers, one for the buttons and one for the stops the movie wouldn't go anywhere.


            I think that my problem is that I am not understanding how the Keyframes work on the actions layers. On other layers if you put one keyframe in the beginning and one at the end the whole movie would contain whatever was on that layers. With the actions it's not like that, I put all the code for all the main buttons on the first frame and add a key frame at the end. Whenever I put the Stop action it would remove the code from the frames that come next.


            Hope I am making sense At least in my head it does.

            • 3. Re: I can't get buttons to work correctly!
              Matt Belshaw Level 1

              You only need to define the buttons in the first frame. Think of it like this. The main timeline is where you can set the variable and properties of your functions that will be present for the entire duration of your "Movie"


              setting them in frame 1 is all you need to do for the movie to remember the details but you must make sure that the buttons are present in every frame, i.e select the last frame of your movie, on the buttons layer, and "Insert Frame" so that the frames are filled through the entire scene.