This content has been marked as final. Show 5 replies
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?
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..
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.
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..
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.