Hey Jack,
Really love LoaderMax so far, but I too was wondering about this feature
BulkLoader actually has a pretty interesting way of doing this. Here's some code I used on a previous project of mine:
var substitutions:Object = new Object();
substitutions.base = _model.base;
substitutions.language = _model.language;
substitutions.stream = Constants.WOWZA_BASE + Constants.WOWZA_OUTPUT;
var url:String = _model.base + ASSETS + "?" + RandomGenerator.generate(4);
_loader = new LazyXMLLoader(url, "nav-siteloader", 5, 10);
_loader.addEventListener("lazyComplete", lazyHandler); // listen for when the external definition finishes loading
_loader.addEventListener(BulkLoader.COMPLETE, completeHandler);
_loader.addEventListener(BulkLoader.PROGRESS, progressHandler);
_loader.addEventListener(BulkLoader.ERROR, errorHandler);
_loader.stringSubstitutions = substitutions;
_loader.allowsAutoIDFromFileName = false;
What I like about this approach is that you can provide as many substitutions as you wish and you don't have to worry about when you do those substitutions. (I gathered from your response that I need to wait until the XMLLoader has fired the INIT event, and that I can't have my LoaderMax node's load attribute set to 'true')
Reasons why this would be useful:
- loading files dependent on language parameters (config_en.xml, config_fr.xml)
- no need to change the XML files when switching from development to live servers (only need to dynamically set the base - or whatever you want to call it - parameter to the site's base url once, through a flashvar or whichever way you prefer)
But it's just a suggestion, for now I'm quite pleased with the prependURL feature.
The XML file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
content
{base}xml/content_{language}.xml
true
1
homeAnim
{stream}static/Intro.flv
true
true
2000