Detect when included .as and .xml-files are loaded


I’m going to load some external files in to my main fla-file. I want the code in my main fla to be executed when all files are properly loaded.

#include “”

I had this:

var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, loadCompleted);
loader.load(new URLRequest("MyFile.xml"));

function loadCompleted(e:Event):void
	trace("XML loaded");

but now I want to include an as-file aswell so both has to be loaded before loadCompleted triggers.