5 Replies Latest reply on Sep 11, 2008 5:01 PM by kglad

    need help with slideshow


      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!

        • 1. Re: need help with slideshow
          kglad Adobe Community Professional & MVP
          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.
          • 2. Re: need help with slideshow
            Geoff008 Level 1
            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?
            • 3. Re: need help with slideshow
              kglad Adobe Community Professional & MVP

              • 4. Re: need help with slideshow
                Geoff008 Level 1
                That works perfectly! Thanks! I really appreciate the help.

                If you don't mind indulging me, I'm trying to figure out which parts do what. What does the "attachImageF()" do?

                • 5. Re: need help with slideshow
                  kglad Adobe Community Professional & MVP
                  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.