Bulk Loader and SWF Caching issues
Posted in Actionscript 3.0, Code Snippets on January 28th, 2009 by Omar Faleh – 1 Commentwhile working with bulk loader on a big project recently, we were hit by one problem that took me a while to solve.
the problem was basically this: if you load an swf with bulkloader, everything looks fine and well..
unload it, try to load it again and it won’t load.. simply becase it is already in the cache of the browser , so the COMPLETE event was never firedthe second time.
I tried to set the {forceCache:false} in the case of loading an swf and that didn’t work also (it added a random string number after the name of the swf, and the container flash won’t load the swf at all in that case)
so.. here is the result of a full day of investigation
if (loader.hasItem(this.id[0] , true))
{
loader.remove(this.id[0]);
}
loader.add(this.bg[0], { id:this.id[0]} );
this way, the onComplete event will get fired after loading the swf for the second time, even though it’s already loaded and present in the cache
simple.. yet not documented properly