Need Help. Kirupa XML/Photo gallery tutorial

Hi, I need a bit of help with a tutorial I found on www.Kirupa.com ( http://www.kirupa.com/developer/mx2004/xml_flash_photogallery.htm ). It’s a tutorial that shows how to create a photo gallery and load the pictures and comments via XML. My problem is the following, the gallery and everything works well, but I when I try to load it into a container then everything messes up. Here’s what I have: I have a main movie ( the main .swf file ) with a container in it, when clicking on one of the buttons from that movie the gallery.swf loads into the container ( the gallery is the exact gallery from the tutorial ) and it works well, until I press the button to load it again. It seems that it messes up the value of “p”. I tried tracking it, on the first load it tracks normally p=1, 2, 3, 4… but on the second load it reacts as if it’s double tracking it p=0 1, 2 2, 3 3, 2 4 … It seems that Flash somehow keeps the old value of “p” in mind. I tried reseting it somehow or something but I can’t seem to make it work ( or maybe I have to rebuild the whole thing ? ).

It works perfectly if I load it only once but if I load the gallery.swf twice or more times then it goes crazy ( or since I have more buttons on the stage, after pressing one and coming back to the gallery, it does the same, it’s messed up ). How can I “reset” the value of 0 on every load or something ? I even tried playing around with unloadMovie but that didn’t help ( or I can’t figure out how to use it ).

Any feedback is really appreciated.

:jail: