Xml Grid - new issue to be resolved!

Hey peeps!
I’ve used the XML grid photo gallery on my website that was featured in a tutorial on this website: http://www.republicofcode.com/tutorials/flash/as3gridgallery/index.php.

However, whenever I click on another area of my website (eg. the contact page, homepage etc) … the XML photo gallery still remains on the screen. I’ve been told to use the code (below) but it still hasn’t resolved the issue. Where exactly do I post the code? All of my code for my background music, navigation buttons etc for my website are on one frame in the timeline.

 
// Register your button
my_btn.addEventListener (MouseEvent.CLICK, removeGallery);
 
function removeGallery (e:MouseEvent):void {
// Remove any event listeners you have for the gallery container
// Then write this
removeChild (container_mc);
container_mc = null;
 
//The remove the listener from what ever button called this function
my_btn.removeEventListener (MouseEvent.CLICK, removeGallery);
}