# Slideshow gallery into a website issues

**URL:** <https://forum.kirupa.com/t/slideshow-gallery-into-a-website-issues/319879>\
**Category:** Uncategorized\
**Created:** [March 7, 2011, 5:43pm UTC](https://forum.kirupa.com/t/slideshow-gallery-into-a-website-issues/319879 "2011-03-07T17:43:57Z")\
**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:** [March 7, 2011, 5:43pm UTC](https://forum.kirupa.com/t/slideshow-gallery-into-a-website-issues/319879/1 "2011-03-07T17:43:57Z")

</div>

Hello

I’ve made a website using AS3 in CS5 Flash, I then decided to add a ‘Slideshow Gallery’ into the site. I made a new page, called it ‘gallery’ (this page is made from frames 73-86) and then looked at making a slideshow.

The first one I made was from this site;  
[layersmagazine.com/flash-slideshow-image-gallery.html](http://layersmagazine.com/flash-slideshow-image-gallery.html)

and the script was;

stop();  
//next button  
next\_btn.onPress=function(){  
if(mc\_content.\_currentframe==mc\_content.\_totalfram es){  
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()  
}  
}

When i publish this, it says the ‘last\_btn’ and ‘next\_btn’ contain errors and wont publish correctly. I think basically this needs updating to a as3 script, however I am no good at ‘upgrading’ scripts, can anyone help?

I also tried using the slideshow tutorial, inbuilt in the cs5 flash, this script was;

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

// EVENTS =====  
playPauseToggle\_mc.addEventListener(MouseEvent.CLI CK, 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

HOWEVER! when I try to play this slideshow it goes to ‘frame 1’ So I think somewhere it just needs a script saying start and finish from frames 73-86? But i’m not sure.

Thanks for taking a look
