Código:
var listaXML:XML = new XML();
listaXML.ignoreWhite = true;
listaXML.onLoad = function (sucess:Boolean) {
if (sucess) {
var photographers:Array = this.firstChild.childNodes;
for(i = 0; i < photographers.length; i++) {
_root.attachMovie("mcBoton", "btn"+i, _root.getNextHighestDepth());
_root["btn"+i]._x = 50;
_root["btn"+i]._y = 20 + (i * 30);
_root["btn"+i].texto = photographers[i].childNodes[0].firstChild;
_root["btn"+i].swf = photographers[i].childNodes[1].firstChild;
_root["btn"+i].onRelease = function () {
_root.containerswf.loadMovie(this.swf);
}
}
} else {
trace("Error al Leer archivo XML");
}
}
listaXML.load("lista.xml");

