0; --i){
ResourceManager.getInstance().removeResourceBundlesForLocale(ResourceManager.getInstance().getLocales()[i-1]);
}
}
// Try calling loadResourceModule and add the event listeners in the same block of AS.
// ed15, ed18, and ed23 aren't anything yet, so we can't pass them in, and we can't pass
// by reference in Actionscript.
private function setUpEventDispatcher(ed:int, url:String):void{
var ied:IEventDispatcher;
switch(ed){
case 15:
ed15 = ResourceManager.getInstance().loadResourceModule(url);
ied = ed15;
break;
case 18:
ed18 = ResourceManager.getInstance().loadResourceModule(url);
ied = ed18;
break;
case 23:
ed23 = ResourceManager.getInstance().loadResourceModule(url);
ied = ed23;
break;
}
ied.addEventListener(ResourceEvent.PROGRESS, handleProgressEvent);
ied.addEventListener(ResourceEvent.ERROR, handleErrorEvent);
ied.addEventListener(ResourceEvent.COMPLETE, handleCompleteEvent);
}
private function handleErrorEvent(e:ResourceEvent):void{trace("handleErrorEvent: " + e.toString())}
private function handleProgressEvent(e:ResourceEvent):void{trace("handleProgressEvent: " + e.toString())}
private function handleCompleteEvent(e:ResourceEvent):void{trace("handleCompleteEvent: " + e.toString())}
]]>