Topic: Before and After Image

First of all I have to say that this image gallery is excellent and I've found it very easy to implement.

However, I'm struggling to add in a bit of functionality that I need. I'm trying to customise the code to show a before and after image so that it displays a re-touched photo whenever you click on the gallery thumbnail and then you have the option to click on a link to display the 'before' image. Hence I've added in some extra attributes to the XML i.e.

<image>
    <filename>115-1503_IMG.jpg</filename>
    <caption>Caption 1</caption>
    <beforefilename>115-1503_before_IMG.jpg</beforefilename>
    <beforecaption>Caption 1</beforecaption>
</image>

I've added in the relevant bits to the XMLManager.as to pull out the beforefilenames i.e.

imageBeforeFileNames.push&#40;resultNode.childNodes&#91;2&#93;.firstChild.nodeValue&#41;;                                    
imageBeforeCaptions.push&#40;resultNode.childNodes&#91;3&#93;.firstChild.nodeValue&#41;;

In ImageArea.as I have modified the code to add to a separate mBeforeImages[i] array i.e.

mBeforeImages&#91;i&#93; = new Image&#40;mBeforeImageHolder_mc, i, mXMLManager.imagePath + mXMLManager.imageBeforeFileNames&#91;i&#93;,this&#41;;

...and then in the showImage function I've added some script to call another function to load the 'before image' i.e.

mShowBeforeBtn.doAction = Delegate.create&#40;this, onClickLoadBeforeImage&#41;; 

this is the onClickLoadBeforeImage function:

    private  function onClickLoadBeforeImage&#40;&#41;&#58;Void&#123;    
//trans out old img
mImages&#91;mCurrentImageIndex&#93;.hideImage&#40;&#41;;
mBeforeImages&#91;mCurrentImageIndex&#93;.showImage&#40;&#41;;
&#125;    

Unfortunately the 'before image' doesn't load. If I do a trace on the 'before image' filename then it shows the correct filename i.e.

trace &#40;mXMLManager.imagePath + mXMLManager.imageBeforeFileNames&#91;mCurrentImageIndex&#93;&#41;;

So it's extracting the correct filename from the XML but somewhere in ImageArea.as I'm going wrong.
Any help on this would be really appreciated!!!

Many thanks in advance.

Mike