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

**URL:** <https://forum.kirupa.com/t/detect-when-included-as-and-xml-files-are-loaded/288568>\
**Category:** Uncategorized\
**Created:** [May 18, 2009, 12:18pm UTC](https://forum.kirupa.com/t/detect-when-included-as-and-xml-files-are-loaded/288568 "2009-05-18T12:18:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThinkKirupa](https://avatars.discourse-cdn.com/v4/letter/t/e9bcb4/32.png) [@ThinkKirupa](https://forum.kirupa.com/u/ThinkKirupa)\
**Post date:** [May 18, 2009, 12:18pm UTC](https://forum.kirupa.com/t/detect-when-included-as-and-xml-files-are-loaded/288568/1 "2009-05-18T12:18:05Z")

</div>

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:

```auto
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.
