Help with loading external jpegs

Hi, I am trying to load some external jpegs on a site and I have the function done for MX
function loadPic(mc, picName) {
var myFile = “images/”+picName+".jpg";
mc.loadMovie(myFile);
}

I also have the button code done.

button1.onRelease=function() {
loadPic(“fam1”);
}

I’ve set up on the main timeline a frame/layer just for actionscript and the button I want to launch the image into the “mc” is down 2 levels. Where do I put the button code (MX) and the mc movie clip? Do they all have to be on the main timeline or can I somehow tell Flash where the button is and how to find the image and the function? I’m new and confused. Please help, I can feel myself going gray as I write.

Thanks,
Adam