How to correctly load external assets in background?

This is something I still haven’t grasped, even after reading through many “photo gallery” tutorials. Here’s my situation:

I’m making a Flash site with a large photo gallery. So, I definitely want to load the images at run-time. However, I would like to pre-load them in the background while the user is interacting with the rest of the site, possibly cutting the wait time for each photo to load when the user actually opens the gallery.

My idea was to load the the swf on frame 1, then on frame 2 create an array and start loading all the images into it. Then, when the gallery is opened, each image container movieClip will first try to access the correct element of the array; if the image isn’t found there, then I show a preloader and load the image then and there. I’m not 100% sure how to actually write the code for this, but doesn’t seem that difficult.

Does that sound right though? I don’t want go this route if there’s a better/more functional approach out there. Thanks!