Specify mc container from xml file

Hi all,

I am loading in a series of assets from an xml file like this:

<?xml version="1.0" encoding="utf-8"?>
    <asset name="background" src="assets/backgrounds/red_wood.jpg" type="image" container="background_holder" width="100" height="100" />

I then loop through each asset node and add it to a LoaderMax var. The problem I am having is that I want to declare the container for the asset I am loading in the XML file, but when I try the following code I get this error message:

Error #1034: Type Coercion failed: cannot convert [email protected] to flash.display.MovieClip.
Can anyone help me with this please?


var xml:XML = event.target.content;
var assetsList:XMLList = xml.asset;

var mainLoader:LoaderMax = new LoaderMax({name:"mainLoader",onComplete:mainLoaded,onProgress:mainProgressHandler});

for (var i:int = 0; i < assetsList.length(); i++) {
    var assetLoad:ImageLoader = new ImageLoader(assetsList*[email protected], new ImageLoaderVars()
        .name(assetsList*[email protected])
        .width(assetsList*[email protected])
        .height(assetsList*[email protected])
        .container(MovieClip(assetsList*[email protected]))