Topic: Capturing Captions in a variable

I have created a series of galleries all of which work fine.  The images show up fine and the captions are correct etc

I want to capture the current image caption in a variable in the Multiple Galleries FLA so I can use this to send people to individual pages about each image.

I've created a dynamic text box and gave it a variable name "current_caption" but I cant get it to show the Caption of the current image.

CAN ANYONE HELP WITH THE CODE TO CAPTURE THIS CAPTION form the Gallery?  Its sending me nutty.



Re: Capturing Captions in a variable

For Example this code will capture the name of the gallery currently open into a variable called "current_gallery"

set (current_gallery, xmlDataPath)

I need a similar code to tell me what the caption on the current image says or the file name would do too.

It must be possible as the caption name changes as you flick through. So it has to be possible to pull out the current caption so it can be used elsewhere?

It looks like the gallery opens inside a movieclip called mcLoader so it might be something like

set (current_caption, mcLoader.mCaption_mc.txtText)
set (current_caption, mCaption_mc.txtText)

However none of these work.

Does anyone know how to retreive this info?


Re: Capturing Captions in a variable


Felix Turner
SimpleViewer Support Team.

Re: Capturing Captions in a variable

Hi Felix thanks for your help but this hasn't worked.

I've setup an Input Text field so I can see what the code retreives.  When I run the following code via a button action using your suggestion I get "undefined" as my output.

The code I'm using is

on (release) {
set (current_caption, XMLManager.getInstance().imageCaptions[ThumbArea.getInstance().selectedThumbIndex]);}

I'm OK if its easier to retreive the image name rather than the caption.  Do you know what might be causing the error.  Thanks for your help so far...

Re: Capturing Captions in a variable


I have been trying to do exactly the same thing and have had no luck. I tried the code that Felix recommended and still have not been able to get it to work.

If anyone has a solution to this problem it would be great!