Skip to main content
Participating Frequently
September 11, 2008
Answered

need help with slideshow

  • September 11, 2008
  • 2 replies
  • 575 views
Hello.

I started this awhile ago, but had to put it on the backburner for awhile. Basically all I need to do is make a slideshow that will cycle through 8 images (more will be added later) when a site's main page comes up. The rest of the site is in html, so this needs to be a self-contained kind of thing that will either start on its own, or that the html code can start (I really don't know html, and that's someone else responsibility, so I'm not worrying about that).

Here is my attempt at coding this. You may be able to tell that I basically went through these forums and tried to piece something together from other bits of code that I found. While I'm sure that this code is laughable to the more experienced people out there, I don't know how laughable. If I'm anywhere close to being on the right track here, please let me know. Otherwise, any help you can offer is much appreciated. Thanks!

This topic has been closed for replies.
Correct answer kglad
try:

2 replies

kglad
Community Expert
Community Expert
September 12, 2008
you're welcome.

attachImageF() attaches a movieclip using the initialized imageNum on its first call and it updates imageNum to the next number.

you can always use the trace() function to see what your code is doing.
kglad
Community Expert
Community Expert
September 11, 2008
where are the images? have they been converted to movieclips? do they have linkage ids? why the attempt to introduce randomness?

and you didn't display a setInterval() function. is there one elsewhere? if not, does anything call runTimer()? and runTimer() executes the code between { and } just after "Void". ie, it does nothing.
Geoff008Author
Participating Frequently
September 11, 2008
Sorry, should've been more clear on that. Yes, the images have been converted to movie clips, adn the linkage ID's are img1-img8. The reasoning behind that is that, at some point, new pictures will take the place of the current pictures.

The attempt at randomness is actually a leftover from a previous incarnation of this project. Ideally I'd like the pictures to always play through in the same order, but I'd like it to start at a random place in that order so it's not always the same image coming up when the page first comes up. So, basically, I left it in for lack of a better idea.

As for the setInterval() and runTimer() and "Void" question, that part is complete patchwork on my part. I'm not surprised that I missed something or included something extra. There isn't any code beyond what's attached in my previous post.

I think, at the time, I was hoping that the "if(timePassed > nTimeout){" part was on the right track, but are you saying that the void cancels that part out?
kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
September 11, 2008
try: