# Multiple Photo Galleries in Flash

**URL:** <https://forum.kirupa.com/t/multiple-photo-galleries-in-flash/321216>\
**Category:** flash\
**Created:** [April 13, 2011, 3:14pm UTC](https://forum.kirupa.com/t/multiple-photo-galleries-in-flash/321216 "2011-04-13T15:14:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rarity](https://avatars.discourse-cdn.com/v4/letter/r/43a26b/32.png) [@Rarity](https://forum.kirupa.com/u/Rarity)\
**Post date:** [April 13, 2011, 3:14pm UTC](https://forum.kirupa.com/t/multiple-photo-galleries-in-flash/321216/1 "2011-04-13T15:14:50Z")

</div>

Hey, I already have a photo gallery running on my website, but I would like to add 4/5 more. The script I am currently using is;

```auto

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

// EVENTS =====

next1_btn.addEventListener(MouseEvent.CLICK, fl_next1ButtonClick);
prev1_btn.addEventListener(MouseEvent.CLICK, fl_prev1ButtonClick);
function fl_next1ButtonClick(evt:MouseEvent):void
{
    fl_nextSlide();
}
function fl_prev1ButtonClick(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();
}
var firstImageFrame:int = 9;
var lastImageFrame:int = 16;
var numImages:int = lastImageFrame - firstImageFrame; //can't use totalFrames anymore

function fl_nextSlide():void{
  currentImageID++;
  if(currentImageID > numImages){
    currentImageID = 0;
  }
  gotoAndStop(currentImageID+firstImageFrame);
}
function fl_prevSlide():void{
  currentImageID--;
  if(currentImageID < 0){
    currentImageID = numImages;
  }
  gotoAndStop(currentImageID+firstImageFrame);
}

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

```

I’ve obviously changed the first and last frame part of the script to suit where I have put my images.  
And I have also changed the next and prev button to be next1 and prev1, however the rest wont work, i’m guessing I need to change a lot more but I don’t know enough about scripting. Can anyone please help? ☹
