Creating a function to unload a series of movies

Hi I’ve had to create the following code to get a series if loading movies to work properly. Each loaded movie is basically a series of automatically looping images controlled by external xml. I found that without adding the unload movie on each button action the first movie loaded kept playing over any subsequent movies loaded. However its rather long winded and if the amount of movies increase it really is going to be very large. Would anyone have any guidance as to how to create an efficient funtion that does the job in a more effective way:

intro_mc.onRelease = function() {
unloadMovie ("_root.container02");
unloadMovie ("_root.container03");
unloadMovie ("_root.container04");
createEmptyMovieClip(“container01”, 2);
loadMovie(“deaf_intro.swf”, “container01”);
container01._x = 270;
container01._y = 173;
};

before_mc.onRelease = function() {
unloadMovie ("_root.container01");
unloadMovie ("_root.container03");
unloadMovie ("_root.container04");
createEmptyMovieClip(“container02”, 2);
loadMovie(“deaf2.swf”, “container02”);
container02._x = 270;
container02._y = 173;
};
music_mc.onRelease = function() {
unloadMovie ("_root.container01");
unloadMovie ("_root.container02");
unloadMovie ("_root.container04");
createEmptyMovieClip(“container03”, 2);
loadMovie(“deaf3.swf”, “container03”);
container03._x = 270;
container03._y = 173;
};

after_mc.onRelease = function() {
unloadMovie ("_root.container01");
unloadMovie ("_root.container02");
unloadMovie ("_root.container03");
createEmptyMovieClip(“container04”, 2);
loadMovie(“deaf4.swf”, “container04”);
container04._x = 270;
container04._y = 173;
};