cod XML
Código :
<imagenes> <imagen id="images/img01.jpg" caption="imagen uno"/> <imagen id="images/img02.jpg" caption="imagen dos" /> <imagen id="images/img12.jpg" caption="imagen doce" /> </imagenes>
este es el AS2
Código :
x = 10; y = 20; ancho = 105; alto = 80; num_columnas = 3; miXML = new XML(); miXML.ignoreWhite = true; miXML.onLoad = function(succes) { if (succes) { for (var i = 0; i<this.firstChild.childNodes.length; i++) { galeria = this.firstChild.childNodes[i].attributes.id; _root.createEmptyMovieClip("diapo"+i, i+100); item = _root["diapo"+i]; item.loadMovie(galeria); item._x = x; item._y = y; x += ancho; columna += 1; if (columna == num_columnas) { columna = 0; x -= (ancho*num_columnas); y += alto; } } } }; miXML.load("script.xml");