Jump to content


Autoplaying Slideshow on website


  • You cannot reply to this topic
1 reply to this topic

#1 Ecuaman801

    Young Padawan

  • Members
  • Pip
  • 1 posts

Posted 14 February 2007 - 06:48 PM

Hi. I'm trying to create a slideshow that would scroll through different ads for my bank's website. I want to have it start to "autoplay" through the ads, changing every 10 seconds or so. I would also like to have forward, pause, and back buttons so the user could scroll through them if they don't want to wait for the autoplay. I see samples of this on lots of websites to display their news headlines, like pcworld.com, and worldofwarcraft.com. Please help! Thanks in advance...
-Cam

#2 Demonslay

    P2L Jedi

  • Members
  • PipPipPip
  • 970 posts
  • Gender:Male
  • Location:A strange world where water falls out of the sky... for no reason.
  • Interests:Graphic Design, Coding, Splinter Cell, Cats

Posted 14 February 2007 - 08:25 PM

All you'd have to do is use the gotoAndStop() and the nextFrame() methods.
For example, on your root actionscript timeline, you could have something like this.

nextButton_mc.onRelease = function(){
_root.nextFrame();
}

I honestly don't know (or understand) how to make the back button, try Googling it and playing with the results.

As for autoplay, you can use an interval.

function setAutoplay(){
var autoplay = setInterval(function(){ _root.nextFrame(); }, 10000);
}

function unsetAutoplay(){
clearInterval(autoplay);
}

playButton_mc.onRelease = function(){
setAutoplay();
}

pauseButton_mc.onRelease = function(){
unsetAutoplay();
}

I'm just learning Flash myself, but that should atleast get you started more or less. :)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users