# as3 loading library items

**URL:** <https://forum.kirupa.com/t/as3-loading-library-items/290510>\
**Category:** flash\
**Created:** [June 16, 2009, 12:20am UTC](https://forum.kirupa.com/t/as3-loading-library-items/290510 "2009-06-16T00:20:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![josesenra](https://avatars.discourse-cdn.com/v4/letter/j/839c29/32.png) [@josesenra](https://forum.kirupa.com/u/josesenra)\
**Post date:** [June 16, 2009, 12:20am UTC](https://forum.kirupa.com/t/as3-loading-library-items/290510/1 "2009-06-16T00:20:04Z")

</div>

hi all… I got this question about loading some library items , using some XML data…

here goes… I have an xml object that looks like this:

```auto
<menu>
    <item text="Colocar Paredes">
        <submenu tipo="quadrada">Parede Quadrada</submenu>
        <submenu tipo="l">Parede em 'L'</submenu>
        <submenu tipo="u">Parede em 'U' - 3 Paredes</submenu>
        <submenu tipo="paralelas">Paredes paralelas - 2 Paredes</submenu>
        <submenu tipo="unica">Parede única</submenu>
    </item>
</menu>

```

I load it fine and use it fine too…

I got 5 movie clips on my library that I want to load , one for each submenu on the xml object…

thought that

```auto
for (var j = 0; j < dadosXML.item[0].submenu.length(); j++) {
                    objecto = DisplayObject(dadosXML.item[0].submenu[j].@tipo);
                    var btn:objecto = new objecto();
                }

```

would do the trick but it doesn’t… I don’t want to use the library movie clips’ linkage name , rather using the @tipo attribute, wich is the same as the linkage name for each mc…

can anyone help me on this??

thanks in advance…

jose senra
