views:

15

answers:

0

Hi chaps, I'm trying to load a module from an air application. Using ModuleManager. My loading code looks rather like:

public function loadModule(lib:String):void
{
 //lib = "file:///path/to/my.swf"
 var moduleInfo:IModuleInfo = ModuleManager.getModule(lib);
 moduleInfo.addEventListener(ModuleEvent.READY, moduleLoaded);
 moduleInfo.addEventListener(ModuleEvent.PROGRESS, moduleLoaded);
 moduleInfo.addEventListener(ModuleEvent.SETUP, moduleLoaded);
 moduleInfo.addEventListener(ModuleEvent.ERROR, errorHandler);
 moduleInfo.addEventListener(ModuleEvent.UNLOAD, errorHandler);
 moduleInfo.addEventListener(IOErrorEvent.IO_ERROR,errorHandler);
 moduleInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR,errorHandler);
 moduleInfo.load( ApplicationDomain.currentDomain);
}

However when I do this the errorHandler method gets called with a mx.events.ModuleEvent that says "SWF is not a loadable module". Google seemed to think this was because I didn't have a crossdomain.xml file specified, but as I'm loading from the local filesystem I'm not sure I see how I can specify one?