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
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