# Specify mc container from xml file

**URL:** <https://forum.kirupa.com/t/specify-mc-container-from-xml-file/323499>\
**Category:** Uncategorized\
**Created:** [July 4, 2011, 2:42pm UTC](https://forum.kirupa.com/t/specify-mc-container-from-xml-file/323499 "2011-07-04T14:42:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ourweehome](https://avatars.discourse-cdn.com/v4/letter/o/3ec8ea/32.png) [@ourweehome](https://forum.kirupa.com/u/ourweehome)\
**Post date:** [July 4, 2011, 2:42pm UTC](https://forum.kirupa.com/t/specify-mc-container-from-xml-file/323499/1 "2011-07-04T14:42:05Z")

</div>

Hi all,

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

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

```

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 XMLList@2ebc2e51 to flash.display.MovieClip.  
> Can anyone help me with this please?

Thanks!

```auto
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*.@src, new ImageLoaderVars()
        .name(assetsList*.@name)
        .width(assetsList*.@width)
        .height(assetsList*.@height)
        .smoothing(true)
        .container(MovieClip(assetsList*.@container))
        );
    
    mainLoader.append(assetLoad);
    
}

mainLoader.load();

```
