5 Replies Latest reply on Sep 12, 2007 7:49 AM by clbeech

    Dynamic Slideshow

    Seise Level 1

      I´ve learned how to do a dynamic slidshow by watching: http://www.learnflash.com/wp/2007/basic-animated-slideshow/ and http://www.learnflash.com/wp/2007/buttons-for-dynamic-slideshows/ but there are still one thing I miss in my slideshow and that´s a "caption" do any one know how to do a caption and what to write in the Actionscript?

      PLEASE I NEED HELP!! Micke
        • 1. Re: Dynamic Slideshow
          clbeech Level 3
          There are a variety of ways to do this. How would you like to bring your infomation in if your going truely dynamic? XML, plain text file, database?
          • 2. Dynamic Slideshow
            Seise Level 1
            It would be plain text field. Because I haven´t a XML connected at all. I have my photos in a file and load them external with only actionscript.. But I don´t know if a continbox is so necessary... But it would be fun to have anyway..
            • 3. Re: Dynamic Slideshow
              clbeech Level 3
              OK, if you store your picture captions in a 'plain text file' then you will want to use the LoadVars class to retrieve them, read the text, split the string into an array and then assign the text strings to a 'dynamic textField' on each change of the slide. You will need to coordinate the order of the information with the order of the photos to match.

              But what method are you using to load the photos? you also may be able to just set up an array within the fla to propagate the field on each call to the next photo, this way you would not have to deal with another external file.
              • 4. Re: Dynamic Slideshow
                Seise Level 1
                My photos are loaded by an Array, and it works fine.. But it just what I shall write so I can see the contain and where I should write the text that should show..
                • 5. Dynamic Slideshow
                  clbeech Level 3
                  Great, set up another array, and fill it with the captions as stings that match the order of the photos array, like so:

                  var photos:Array = [bird.jpg, frog.jpg, cat.jpg];
                  var captions:Array = ["bird", "frog", "cat"];

                  Now on a new layer above the layer your loading the photos into, create a 'dynamic' textField embed the chosen font, and give it an instance name.

                  Then in the method you are using to load the photo, add a statement to assign the text from the captions array to the textField, with the matching index number, it will be something like:

                  caption_txt.text = captions[index];

                  But I do not know the methods or variables you are using to invoke the changes, just match the currently selected index number to the one being used for the photo.