5 Replies Latest reply: Mar 4, 2013 7:48 AM by kglad RSS

    Simple Photo Album "previous" button issue

    jwood_its

      Hello!  I have created a slide show using the Simple Photo Album template in Flash.  All works fine except for when I click the "previous" button to view the previous slide.  When I click it, the movie skips back 3 slides instead of just one.  How can I fix this?

       

      Thanks!

       

      Jessie

        • 1. Re: Simple Photo Album "previous" button issue
          kglad MVP

          copy and paste the code that executes when you click your back button.

          • 2. Re: Simple Photo Album "previous" button issue
            jwood_its Community Member

            Oops, here it is!

             

            // USER CONFIG SETTINGS =====
            var autoStart:Boolean = false; //true, false
            var secondsDelay:Number = 2; // 1-60
            // END USER CONFIG SETTINGS

            // EVENTS =====
            playPauseToggle_mc.addEventListener(MouseEvent.CLICK, fl_togglePlayPause);
            function fl_togglePlayPause(evt:MouseEvent):void
            {
            if(playPauseToggle_mc.currentLabel == "play")
            {
              fl_startSlideShow();
              playPauseToggle_mc.gotoAndStop("pause");
            }
            else if(playPauseToggle_mc.currentLabel == "pause")
            {
              fl_pauseSlideShow();
              playPauseToggle_mc.gotoAndStop("play");
            }
            }
            next_btn.addEventListener(MouseEvent.CLICK, fl_nextButtonClick);
            prev_btn.addEventListener(MouseEvent.CLICK, fl_prevButtonClick);
            function fl_nextButtonClick(evt:MouseEvent):void
            {
            fl_nextSlide();
            }
            function fl_prevButtonClick(evt:MouseEvent):void
            {
            fl_prevSlide();
            }
            var currentImageID:Number;
            var slideshowTimer:Timer;
            var appInit:Boolean;
            function fl_slideShowNext(evt:TimerEvent):void
            {
            fl_nextSlide();
            }
            // END EVENTS

            // FUNCTIONS AND LOGIC =====
            function fl_pauseSlideShow():void
            {
            slideshowTimer.stop();
            }
            function fl_startSlideShow():void
            {
            slideshowTimer.start();
            }
            function fl_nextSlide():void
            {
            currentImageID++;
            if(currentImageID >= totalFrames)
            {
              currentImageID = 0;
            }
            gotoAndStop(currentImageID+1);
            }
            function fl_prevSlide():void
            {
            currentImageID--;
            if(currentImageID < 0)
            {
              currentImageID = totalFrames+1;
            }
            gotoAndStop(currentImageID-1);
            }

            if(autoStart == true)
            {
               fl_startSlideShow();
               playPauseToggle_mc.gotoAndStop("pause");
            } else {
              gotoAndStop(1);
            }
            function initApp(){
            currentImageID = 0;
            slideshowTimer = new Timer((secondsDelay*1000), 0);
            slideshowTimer.addEventListener(TimerEvent.TIMER, fl_slideShowNext);
            }
            if(appInit != true){
            initApp();
            appInit = true;
            }
            // END FUNCTIONS AND LOGIC

            • 3. Re: Simple Photo Album "previous" button issue
              kglad MVP

              try:

               

               

              jwood_its wrote:

               

              Oops, here it is!

               

              // USER CONFIG SETTINGS =====
              var autoStart:Boolean = false; //true, false
              var secondsDelay:Number = 2; // 1-60
              // END USER CONFIG SETTINGS

              // EVENTS =====
              playPauseToggle_mc.addEventListener(MouseEvent.CLICK, fl_togglePlayPause);
              function fl_togglePlayPause(evt:MouseEvent):void
              {
              if(playPauseToggle_mc.currentLabel == "play")
              {
                fl_startSlideShow();
                playPauseToggle_mc.gotoAndStop("pause");
              }
              else if(playPauseToggle_mc.currentLabel == "pause")
              {
                fl_pauseSlideShow();
                playPauseToggle_mc.gotoAndStop("play");
              }
              }
              next_btn.addEventListener(MouseEvent.CLICK, fl_nextButtonClick);
              prev_btn.addEventListener(MouseEvent.CLICK, fl_prevButtonClick);
              function fl_nextButtonClick(evt:MouseEvent):void
              {
              fl_nextSlide();
              }
              function fl_prevButtonClick(evt:MouseEvent):void
              {
              fl_prevSlide();
              }
              var currentImageID:Number;
              var slideshowTimer:Timer;
              var appInit:Boolean;
              function fl_slideShowNext(evt:TimerEvent):void
              {
              fl_nextSlide();
              }
              // END EVENTS

              // FUNCTIONS AND LOGIC =====
              function fl_pauseSlideShow():void
              {
              slideshowTimer.stop();
              }
              function fl_startSlideShow():void
              {
              slideshowTimer.start();
              }
              function fl_nextSlide():void
              {
              currentImageID++;
              if(currentImageID >= totalFrames)
              {
                currentImageID = 0;
              }
              gotoAndStop(currentImageID+1);
              }
              function fl_prevSlide():void
              {
              currentImageID--;
              if(currentImageID < 0)
              {
                currentImageID = totalFrames+1;
              }
              gotoAndStop(currentImageID+1);
              }

              if(autoStart == true)
              {
                 fl_startSlideShow();
                 playPauseToggle_mc.gotoAndStop("pause");
              } else {
                gotoAndStop(1);
              }
              function initApp(){
              currentImageID = 0;
              slideshowTimer = new Timer((secondsDelay*1000), 0);
              slideshowTimer.addEventListener(TimerEvent.TIMER, fl_slideShowNext);
              }
              if(appInit != true){
              initApp();
              appInit = true;
              }
              // END FUNCTIONS AND LOGIC

              • 4. Re: Simple Photo Album "previous" button issue
                jwood_its Community Member

                Fantastic!  That did the trick.  Many thanks for the help.

                 

                Jessie

                • 5. Re: Simple Photo Album "previous" button issue
                  kglad MVP

                  you're welcome.