7 Replies Latest reply on Jun 20, 2008 10:24 AM by A.Boother

    MOVIECLIP SLIDESHOW

    A.Boother
      Hi,

      I am trying to create a slideshow that has a 'next' and 'previous' button, which lets you see the next or previous movieclip when you click one of the buttons. I have done the 'next' button but cannot do the 'previous' button, please can someone help!! Also, I would like the next button to disappear when you are at the last image, and the 'previous button' to disappear when you are on the first image. I have attached the code I have created so far.

      Thanks alot!!
        • 1. MOVIECLIP SLIDESHOW
          Frank_Walters
          I am a little puzzled by your use of the setInterval. Can you explain why you took this approach?

          Anyway, here's how I would do the Next/Prev button event handlers.
          • 2. Re: MOVIECLIP SLIDESHOW
            FlashTastic Level 1
            @Frank
            The setInterval is used to programatically fade the image out.

            @A.Boother
            I ran your code and I must be missing something because you don't have any code that actually shows images, it just fades the next image in the array. So if I start with 5 images and run your code: I press next, image 1 fades out, I press next, image 2 fades out, etc. So the question is what functionality do you want your previous button to have? The previous image fades back in? In that case just write a fadeImageIn function and decrement the nCurrentIndex instead of incrementing it.

            Try out the following code:

            Cheers,
            FlashTastic
            • 3. Re: MOVIECLIP SLIDESHOW
              A.Boother Level 1
              Hi,

              Thank you both very much for your help. FlashTastic, I used the code you gave me which worked brilliantly, I have one more question please...sorry im new to flash! I would like the 'next' button to disappear when on the 'prestige' image, so it does not let you click 'next' and not show an image (because the 'prestige' image is the last one). I have uploaded it to a test area to hopefully show you what I mean - http://abwebsitedesign.co.uk/flashtest/

              Thanks again your help is appreciated.
              • 4. Re: MOVIECLIP SLIDESHOW
                FlashTastic Level 1
                Just change this line in your mcNext button from:

                if (nCurrentIndex+1 == aImages.length) {
                mcNext._visible = false;
                }


                to

                if (nCurrentIndex+1 == aImages.length-1) {
                mcNext._visible = false;
                }

                I didn't test it out but it should work.

                Cheers,
                FlashTastic
                • 5. Re: MOVIECLIP SLIDESHOW
                  A.Boother Level 1
                  Excellent thanks alot. I forgot to ask, how would I link each image to a different website?!

                  Regards.
                  • 6. Re: MOVIECLIP SLIDESHOW
                    FlashTastic Level 1
                    image1.onPress = function(){
                    getURL(" http://www.website1.com","_blank");
                    }

                    image2.onPress = function(){
                    getURL(" http://www.website2.com","_blank");
                    }

                    etc..
                    • 7. Re: MOVIECLIP SLIDESHOW
                      A.Boother Level 1
                      Hi,

                      I tried doing the links like this a couple of days ago and it does not work, it only takes you to the first url (which is the 'Greenfield' one in this case, but when you are on the 'Millstock' image it does not take you to the 'Millstock' Website, it still takes you to the 'Greenfield' one). Please see the example of this - http://abwebsitedesign.co.uk/flashtest/ . It also takes you to the adobe website in the current page, any idea why it might do this? also, the 'previous' button does not show when you click 'back' on the last image, it only shows when you click the 'previous' button 2 times.please let me know if you can help with this. Attached is what my code looks like.

                      Many Thanks.