# Xml Grid - new issue to be resolved!

**URL:** <https://forum.kirupa.com/t/xml-grid-new-issue-to-be-resolved/295492>\
**Category:** flash\
**Created:** [August 31, 2009, 12:18pm UTC](https://forum.kirupa.com/t/xml-grid-new-issue-to-be-resolved/295492 "2009-08-31T12:18:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![inspired78](https://avatars.discourse-cdn.com/v4/letter/i/9de0a6/32.png) [@inspired78](https://forum.kirupa.com/u/inspired78)\
**Post date:** [August 31, 2009, 12:18pm UTC](https://forum.kirupa.com/t/xml-grid-new-issue-to-be-resolved/295492/1 "2009-08-31T12:18:35Z")

</div>

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](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.

```auto
 
// 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);
}

```
