unload swf files of the previous map
Posted: 01 Apr 2013, 12:45
Hai....
I needed some info about unloading the swf files of the previous map that are not needed anymore...
I am using the basic methods of loading and adding the swfs of map... like
private function loadMapAssets(skinSwfFilenames:Array, bgSwfFilenames:Array):void
{
mapAssetsLibrariesAppDomain = new ApplicationDomain()
var fileNames:Array = skinSwfFilenames.concat(bgSwfFilenames)
loadCounter = fileNames.length
tempLoaders = []
if (loadCounter > 0)
{
for (var i:int = 0; i < loadCounter; i++)
{
loader = new Loader()
tempLoaders.push(loader)
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onMapSwfFileLoaded)
var request:URLRequest = new URLRequest("libraries/" + fileNames[i])
var context:LoaderContext = new LoaderContext(false, mapAssetsLibrariesAppDomain)
loader.load(request, context);
}
}
}
private function onMapSwfFileLoaded(evt:Event):void
{
loadCounter--;
if (loadCounter <= 0)
{
openSpace.skinAppDomain = mapAssetsLibrariesAppDomain;
openSpace.bgAppDomain = mapAssetsLibrariesAppDomain;
// Render map
var params:MapCenteringParams = new MapCenteringParams();
params.px = 383;
params.py = 239;
openSpace.renderMap(params);
}
}
I am not getting how exactly to unload the swfs of previous map while loading a new map since the adding is done like this
openSpace.skinAppDomain = mapAssetsLibrariesAppDomain;
openSpace.bgAppDomain = mapAssetsLibrariesAppDomain;
Please Help....
I needed some info about unloading the swf files of the previous map that are not needed anymore...
I am using the basic methods of loading and adding the swfs of map... like
private function loadMapAssets(skinSwfFilenames:Array, bgSwfFilenames:Array):void
{
mapAssetsLibrariesAppDomain = new ApplicationDomain()
var fileNames:Array = skinSwfFilenames.concat(bgSwfFilenames)
loadCounter = fileNames.length
tempLoaders = []
if (loadCounter > 0)
{
for (var i:int = 0; i < loadCounter; i++)
{
loader = new Loader()
tempLoaders.push(loader)
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onMapSwfFileLoaded)
var request:URLRequest = new URLRequest("libraries/" + fileNames[i])
var context:LoaderContext = new LoaderContext(false, mapAssetsLibrariesAppDomain)
loader.load(request, context);
}
}
}
private function onMapSwfFileLoaded(evt:Event):void
{
loadCounter--;
if (loadCounter <= 0)
{
openSpace.skinAppDomain = mapAssetsLibrariesAppDomain;
openSpace.bgAppDomain = mapAssetsLibrariesAppDomain;
// Render map
var params:MapCenteringParams = new MapCenteringParams();
params.px = 383;
params.py = 239;
openSpace.renderMap(params);
}
}
I am not getting how exactly to unload the swfs of previous map while loading a new map since the adding is done like this
openSpace.skinAppDomain = mapAssetsLibrariesAppDomain;
openSpace.bgAppDomain = mapAssetsLibrariesAppDomain;
Please Help....