So, I have a Flex project that loads a module using ModuleManager, not a module loader. The problem I encountered is that in order to load an external resource (for example, video or image), the path to load this resource must be relative to the swf module ... not relative to the swf that the module was loading.
Question: how can I load an asset into a loaded module using the path relative to the parent swf and not the swf module?
Arg! Thus, when going through the SWFLoader class, I found this piece of code in the private function loadContent:
if (!(url.indexOf(":") > -1 || url.indexOf("/") == 0 || url.indexOf("\\") == 0))
{
var rootURL:String;
if (SystemManagerGlobals.bootstrapLoaderInfoURL != null && SystemManagerGlobals.bootstrapLoaderInfoURL != "")
rootURL = SystemManagerGlobals.bootstrapLoaderInfoURL;
else if (root)
rootURL = LoaderUtil.normalizeURL(root.loaderInfo);
else if (systemManager)
rootURL = LoaderUtil.normalizeURL(DisplayObject(systemManager).loaderInfo);
if (rootURL)
{
var lastIndex:int = Math.max(rootURL.lastIndexOf("\\"), rootURL.lastIndexOf("/"));
if (lastIndex != -1)
url = rootURL.substr(0, lastIndex + 1) + url;
}
}
}
, , Adobe , swf, swf ( - , ...), , , , - "load about swf", SWFLoader , , , , swf, ... ?