Deleting Created MovieClips And Stopping The Loading

I made a site that load external SWFs to a dynamically created MC. This is needed since I am using a dynamic mask transition using the drawing API. My script in creating the MC target is simple enough:


this.createEmptyMovieClip("mytarget", 999);
mytarget.loadMovie(filename); //filename being a variable for files to load.

This works perfectly well but on the net with slow connection one can easilly see the bug. Pressing on a button will load that particular section. Pressing on another it will start to load that particular section also. But in time you press the second button, when the second file is not yet fully loaded then you press back on the first button it will load back up the first file faster since it was already downloaded and cached. The problem is the second file is continuously loading even if the first file is already loaded.

My solution was to re-create the my target MC so that the file which was continuously loading will stop loading. So instead of creating the empty MC only once, I placed it in a function and called that function everytime a button is clicked. But this didn’t stop the loading.

Is there a method or process to delete an MC created using createEmptyMovieClip? How can I stop a currently loading file?

Hope my situation is clear. Any help would be much appreciated. Thanks!