Skip navigation
Currently Being Moderated

Simple Photo Album "previous" button issue

Mar 4, 2013 5:43 AM

Tags: #cs5 #photo #flash #professional #album #simple

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

 
Replies
  • kglad
    72,261 posts
    Jul 21, 2002
    Currently Being Moderated
    Mar 4, 2013 6:26 AM   in reply to jwood_its

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

     
    |
    Mark as:
  • kglad
    72,261 posts
    Jul 21, 2002
    Currently Being Moderated
    Mar 4, 2013 7:38 AM   in reply to jwood_its

    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

     
    |
    Mark as:
  • kglad
    72,261 posts
    Jul 21, 2002
    Currently Being Moderated
    Mar 4, 2013 7:48 AM   in reply to jwood_its

    you're welcome.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points