Loading multiple External SWFs - Problem

Hi all,

we are running into a weird problem (development in Flash CS4):

  1. We have a main.swf that provides a MovieClipLoader.
  2. The Loader is used to unload the former swf and load the next one into a container-mc.

Unfortunately, the loaded swfs (their classes, methods?) seem to interfere each other.

** Example 1 (solution found):** Two external swfs were compiled by using a utilities.as - the name was the same, however, the utilities.as-files distinguished in coding! Result after loading them in our container (which holds loaded swfs): The 2nd swf gave us “undefined” for different calculations! -> Solution: We changed names of the as-files and it worked afterwards.

Example 2 (unsolved): time.swf is doing date-time-calculations (no as-file needed for compilation). If we load it at first in our main.swf, it works without problems (even if loading and unloading other swfs later on).
But if we load other swfs at first and then time.swf, the calculations don’t work anymore…

We were already trying to find this error somewhere else.

-> The solution stated here had no effect: http://stackoverflow.com/questions/480034/unload-movieclip-before-removing “To remove the instance, including its properties and clip handlers, use MovieClip.removeMovieClip().”

-> We tried loading into different swf_holders (containers), no effect.

-> We tried loading all swfs at once into holders using loadMovie() instead a MovieClipLoader, no effect.

**code excerpt: **

this.createEmptyMovieClip("container", 1);

var swfLoader = new MovieClipLoader(); 
swfLoader.addListener(this);
//...
function initNextMovieClip() {
    swfLoader.unloadClip(container);
    swfLoader.loadClip(swf_url[nextURL], container);
    //...
}

Big question: How to release/clear the memory from old swfs completely? (garbage collection)?

So big question: How to avoid interfering of externally loaded swfs.
Every help is appreciated!

More of our Ideas:
A. Could it be a flash-player version problem?
B. How to do something like in AS3: *Loader.unloadAndStop(). stops execution of the left-over listeners and prompts the garbage collector to remove the external swf file from memory.
*C. Does using security sandboxes help, how to do it in as2?
D. Each loaded swf could clean up and stop executing by itself. But does it clean main.swf memory, and how to do this btw?