Preloader help!

I used the following code to create a preloader for my website:

stop();
mask_mc_height = 1;
this.onEnterFrame = function():Void {
var loadedData:Number = this.getBytesLoaded();
var allData:Number = this.getBytesTotal();
var percent:Number = Math.round(loadedData/allData*100);
mask_mc._yscale = percent;
if (loadedData>=allData) {
gotoAndStop(10);
delete this.onEnterFrame;
}
};

and this worked fine. However, my website is split into pages which I made in flash using frames. Some of these frames are gallery pages, where the thumbnails are loaded from an xml file into a movieclip automatically when the page is loaded. These took a while to load, so I tried to put a preloaded for each page of my website, following exactly the same form as the one above. However, they don’t work - the pages load instantly and then the thumbnails still have to load.

(if you go to my site and click on any of the ‘polaroid’ icons you’ll see what I mean)

I’ve been searching for days for a tutorial that would show my how to make a preloader to load my thumbnail gallery but failed and thought this might work but it doesn’t seem too…

Does anybody have any suggestions?