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

Hi,

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 “MyFile.as”

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.