2 Replies Latest reply on Mar 12, 2008 10:42 AM by Ken_Nielsen

    Slideshow play/pause button?

    FreddyU
      I am just starting to learn actionscript so I really don't know what I'm doing!

      I am looking to make a button that will play or pause my photo slideshow. So it will basically just be starting and stopping movement down the timeline I guess... Problem is, the play and pause will perform two different tasks and look like two different buttons. So I need to know how I can make the button and its actions change as it is clicked. Below is my very crude solution, using the tad bit of actionscript I think I might possibly know...

      Another problem... will my fullscreen command work in a web browser?


      EDIT: Also, I want the variable for playButtonActive or pauseButtonActive to change when the button is clicked. Do you understand what I am trying to do.... Sorry for my lack of knowledge.
        • 1. Re: Slideshow play/pause button?
          RossRitchey Level 4
          Make 2 buttons, one for pause and one for play. Make them the exact same dimensions, and place the Play button on top of the Pause button (same x and y coordinates). They already have instanceNames by your code.

          Code::

          myPauseButton.onPress = function(){
          myPlayButton._visible = true;
          stop();
          }

          myPlayButton.onPress = function(){
          myPlayButton._visible = false;
          play();
          }

          OR, if you want the pause and play buttons separate on the screen (both always visible);

          myPauseButton.onPress = function(){
          myPlayButton.enabled = true;
          myPauseButton.enabled = false;
          stop();
          }

          myPlayButton.onPress = function(){
          myPlayButton.enabled = false;
          myPauseButton.enabled = true;
          play();
          }

          Fullscreen can work from the browser, I have never had the need to do it, though, so I am unsure if a simple fscommand will work, or if you will need some more things as well.
          • 2. Re: Slideshow play/pause button?
            Ken_Nielsen Level 1
            I am a rank beginner with Flash and all I know about actionscript is stop(); which has come in quite handy.

            I wonder if implementing the code given above would be a good next step for me to know how to work with actionscript. I have a slide show, Do I make a new timeline for the button and have one over the top of the other or are they both on separate timelines? How (where) do I name the buttons?

            If you are willing to walk me through this, here is the code from above:

            myPauseButton.onPress = function(){
            myPlayButton._visible = true;
            stop();
            }

            myPlayButton.onPress = function(){
            myPlayButton._visible = false;
            play();
            }


            The next thing is where to place this code, In the same timeline labled actionscript that contains my 'stop' action at the last frame, only at the first frame?

            This will be my first experience in using actionscript, so I need the most basic instruction, like a tutorial, at this point.

            I am very excited about learning to do this,

            Thank You,


            Ken