Convert an xml-loaded pic into a button

I’m new to Actionscript and to Kirupa… I looked everywhere for an answer but all the solutions are too convoluted.

Is there any way to load a picture via xml and convert it into a button afterwards?

The codes loads the correct picture but not nothing seems to happen when I add a mouse listener. see code.


var urls:Array = new Array();

xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("menu/pics.xml");

function loadXML(loaded) {
    if (loaded) {
        var photos:Array = this.firstChild.childNodes;
        for(i=0;i<photos.length;i++) {
            urls.push(photos*.attributes.url);
        }
picloader1.loadMovie(urls[0]);
picloader2.loadMovie(urls[1]);
// etc... 

//it works fine until here. This next line isn't working. why?
picloader1.onRelease = function () {
    getURL("http://www.adobe.com", "_self");
};
}

Any insight to the solution is appreciated!!! thanks in advance.