# External SWF via XML

**URL:** <https://forum.kirupa.com/t/external-swf-via-xml/247754>\
**Category:** flash\
**Created:** [December 29, 2007, 2:12am UTC](https://forum.kirupa.com/t/external-swf-via-xml/247754 "2007-12-29T02:12:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![KILTRO](https://avatars.discourse-cdn.com/v4/letter/k/278dde/32.png) [@KILTRO](https://forum.kirupa.com/u/KILTRO)\
**Post date:** [December 29, 2007, 2:12am UTC](https://forum.kirupa.com/t/external-swf-via-xml/247754/1 "2007-12-29T02:12:15Z")

</div>

Hello everyone. I used the search engine to look for answers but, despite i found some closer results, none of them helped me, so this is my last resort: to bother you people.

Ok, so here are the facts:

I have few buttons generated via XML, and the idea its that when the user click them, an external swf load into a placeholder. The path to the swf is on the XML file, but i cant get it to work. The path works, but within the onMouseDown function it doesnt. Thats it.

By the way, someone knows a better way to load a swf? a movieClipLoader perhaps? (I tried it on the function and didnt work)

Thanks in advance  
Forgot to say, its AS 2.0

```auto

function menuBuild() {
    var Root = this.firstChild;
    var Item = Root.childNodes;
    for (var i = 0; i<Item.length; i++) {
        var currItem = Item*;
        var currButton = attachMovie("menuBTN", "menuBTN"+i, 1+i);
        currButton._x = 9.0;
        currButton._y = 94+(30*i);
        currButton.btnName.text = currItem.attributes.Title;
        var urlPath = currItem.attributes.Path
        trace (currItem.attributes.Path)
        currButton.onMouseDown = function() {
            holder.loadMovie(urlPath);
            trace (currItem.attributes.Path)
            
        };
    }
}

var xmlData:XML = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = menuBuild;
xmlData.load("List.xml");

```

(in this case, currItem.attributes.Path, where Path, on the XML, is item1.swf, as a string)
