Hey, thanks for the quick response.
I'm taking a look at this right now but can't seem to get anywhere.
The XMLLoader has been appended to a LoaderMax loader, and I'm trying to extract the width/height of the image when the LoaderMax onComplete handler has fired (i.e. AFTER everything should have loaded, right?).
If I add an onChildComplete handler to the XMLLoader no event appears to be dispatched for the subloads (the image in the XML). How do I access the ImageLoader seeing as it was created dynamically by the XMLLoader?
Here's the code - I've removed any liquidStage stuff as it's irrelevant -
private function initLoad():void
{
queue = new LoaderMax({name:"mainQueue", onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler});
queue.append( new XMLLoader(rootURL + XMLFile, {name:"xmlDoc", onComplete:completeXMLHandler, onChildComplete:onChildLoaded}) );
queue.load();
}
private function completeXMLHandler(event:LoaderEvent):void
{
trace("XML loaded");
queue.replaceURLText("{imageDirectory}", rootURL + GlobalAccess.pathImages, true);
queue.getLoader("xmlDoc").getLoader("bg").load();
}
private function onChildLoaded(event:LoaderEvent):void
{
trace("sub loaded " + event.target);
}
private function progressHandler(event:LoaderEvent):void
{
trace("progress: " + event.target.progress);
}
private function completeHandler(event:LoaderEvent):void
{
trace(event.target + " is complete! (everything loaded)");
var photo:ContentDisplay = LoaderMax.getContent("bg");
addChild(photo);
TweenLite.from(photo, 1, {alpha:0});
trace(photo.width, photo.height);
GlobalAccess.contentXML = LoaderMax.getContent("xmlDoc");
trace("Here's the XML... \n" + GlobalAccess.contentXML);
}
Hope you can help,
Thanks