We are working on a complex product line for one of our client. The key issue was to load different products / SWF applications into a single html page. It was causing increment in memory used by the browser in the system even if one unloads the loaded SWF from loader. Technical reason behind this was Garbage Collector (GC) was not cleaning its content from it while you unload the SWF from loader. This stuff was working fine previously with AS2.

As AS3 is more powerful in terms of performance and all, it also has some strict rules to follow to gain all the new AVM benefits. Loader will not unload the loaded SWF unless it completely stops doing any activities or listening / broadcasting events. In AS3 there is also changed mechanism of receiving mouse move events on any movieclip. Now we require to obtain such events from stage instead of particular movieclip.

The only workaround to this issue is a trick mentioned by Grant Skinner, which is to initiate new LocalConnections with same name twice. As it will generate error, we require to use catch.
[AS]
try {
new LocalConnection().connect(‘foo’);
new LocalConnection().connect(‘foo’);
} catch (e:*) {}
// the GC will perform a full mark/sweep on the second call.
[/AS]

Thanks Grant, for finding the catch and Adobe should do something about this issue J