Topic: Image location counter

This gallery is amazing so before I ask my question I just want to thank you for supplying such a great piece of flash at an affordable price. Also the support forum is perfect, great job guys!

I was wondering, I love the way the gallery works but I would like it if there was the possibility to add in an image counter to be displayed below the main image that would be fantastic.

So perhaps something that said 'Image 01 of 35'

I got as far as adding a counter to your xml load function as seen below:

function xmlLoaded(success){
    trace("Loaded XML: " + success);
    mcLoader.onEnterFrame = undefined;
    if (success){            
        _global.item_count = this.firstChild.childNodes.length;
        mcLoader.setLoadBarWidth(1);
        gotoAndPlay("done");                                                    
    }else{
        trace("Load XML failed");
        mcLoader.gotoAndStop(3);
        mcLoader.setLoadBarWidth(0);
    }    
}

Using this I could make a dynamic text field that outputs the total images in the xml but obviously its not that simple, I have the following problems:

     > How do I detect what the current image being displayed is??

     > If i was to make a movieclip that had a couple of dynamic text boxes in to display the counting text, how do i dynamically position it below the main image??

If you could either give me some pointers on where to add code that would be great ^_^ Better still if you can tell me what code to add where, that would be fantastic!

Thanks again for this awesome product,

Pete

Re: Image location counter

Similarly adding a page 01 of 03 for the thumnbnail scroller would be nice.

^_^

Re: Image location counter

Ohh ok this might be useful to some of you ^_^

In the main simpleviewer fla I clicked into the preloader and went to the frame loadXML and added this bit into the load XML function:

function xmlLoaded(success){
    trace("Loaded XML: " + success);
    mcLoader.onEnterFrame = undefined;
    if (success){            
        _global.item_count = this.firstChild.childNodes.length;
        mcLoader.setLoadBarWidth(1);
        gotoAndPlay("done");                                                    
    }else{
        trace("Load XML failed");
        mcLoader.gotoAndStop(3);
        mcLoader.setLoadBarWidth(0);
    }    
}

I changed the function in StageManager.as to this:

public function showCaption(index:Number){
        var cap = mXMLManager.imageCaptions[index];
        if (cap == undefined) cap = ""; 
        mCaption_mc.txtText.htmlText = "image " + &#40;index + 1&#41; + " of " + _global.item_count + "<br>" + cap;        
    &#125;

This then displays the caption as

"whatever text you put in the xml" (then a line break)
image 01 of 19