5 Replies Latest reply on Jun 25, 2009 1:46 PM by Ned Murphy

    make buttons function

    creeter

      i am new to this and i need to put a simple picture show an a web page, i need  it to work like a powerpoint presentation but also needs buttons that you can roll your mouse over and have the slide that is associated with it come back up and also need to be able to click it to bring it back and stay on the screen for a longer period of time.

      rafting-web-ready.jpg

      I need for the picture in the middle to be what changes

      any help would be great

      thank you in advance

      creeter

        • 1. Re: make buttons function
          Ned Murphy Adobe Community Professional & MVP

          I doubt you'll be getting a thorough tutorial regarding how to do what you want--if you can try something and show code that's giving you problems, you are more likely to get help.

           

          You should find some Flash design lessons somewhere, maybe www.lynda.com.  You might also try Googling for tutorials on how to code buttons and other things.  If you were to search for "AS2 slideshow tutorial" you may find something that has controls similar to what you want that you can hopefully figure out how to adapt for the additional functionality you want.

           

          For a kick start though... assign instance names in the properties panel for each of your buttons.  That will enable them to have code assigned to work for them.  Button code is placed in the timeline where the buttons exist and is assigned as follows:

           

          btnName.onRelease = function(){

               // code to do somerthing

          }

           

          btnName.onRollOver = function(){

               // code to do something

          }

           

          btnName.onRollOut = function(){

                // code to do something

          }

           

          There is another way to code buttons in AS1/AS2, but it is not recommended as a good practice.

          • 2. Re: make buttons function
            creeter Level 1

            i tried to your suggestion already and when i tried to play the animation i got an error

            that said it was expecting a } before the end of the program

            looked at the adobe site where i copied code from , looked the same but copy and pasted again and still had error

            like i said, new, using cs4

            thanks again

            • 3. Re: make buttons function
              Ned Murphy Adobe Community Professional & MVP

              Show what you used that isn't working

              • 4. Re: make buttons function
                creeter Level 1

                here is what i used

                stop();
                //next button
                next_btn.onPress=function(){
                if(mc_content._currentframe==mc_content._totalframes){
                mc_content.gotoAndStop(1)
                }else{
                mc_content.nextFrame()
                }
                }

                //last button
                last_btn.onPress=function(){
                if(mc_content._currentframe==1){
                mc_content.gotoAndStop(mc_content._totalframes)
                }else{
                mc_content.prevFrame()
                }
                }

                • 5. Re: make buttons function
                  Ned Murphy Adobe Community Professional & MVP

                  There doesn't appear to be anything wrong with that code.  So I can only imagine that it isn't all of the code you had when you were getting the error message.  One thing I am noticing is there are different fonts for the code you show, which may mean that some invisible control character was added due to copying and pasting the code.