Comunidad de diseño web y desarrollo en internet online

problema duplicando y posicionando mclips cargados desde xml

Citar            
MensajeEscrito el 23 Ene 2005 10:50 pm
hola a todos y felicidades por el sitio
esto trabajando en un codigo que carga jpegs desde un xml y los mueve a una cierta posicion, mas o menos esto>

Info = new XML();
Info.ignoreWhite = true;
Info.onLoad = function() {
picture = this.firstChild;
count = picture.childNodes.length;
for (child=0; child<count; child++) {
currentPicture = picture.childNodes[child];
currentThumb = item_1.duplicateMovieClip("thumbnail"+child, child);
currentThumb._xscale = 15;
currentThumb._yscale = 15;
currentThumb._alpha = 1;
_root.currentThumb.xDest = child*50;
_root.currentThumb.yDest = child*1;
image = currentThumb.createEmptyMovieClip("thumbnail_image", 0);
image.loadMovie(currentPicture.attributes.THUMB);
}
};
Info.load("Info.xml");


el problema es que quisiera ubicar los mcs creados en columnas y filas, he visto que se puede hacer con dos loops for... anidados como este>

for(y = 1; y <= 4; y++){
for (x = 1; x <= 9; x++){
depth++;
_root.item_1.duplicateMovieClip("item_" add x add "_" add y, depth+2);
_root["item_" add x add "_" add y]._x = _root.item_1._x + (50 * (x-1));
_root["item_" add x add "_" add y]._y = _root.item_1._y + (50 * (y-1));
}
}

pero no se como combinar los dos scripts, gracias por adelantado

Por azionescript

0 de clabLevel



 

msie
Citar            
MensajeEscrito el 25 Ene 2005 03:42 am
Has intentado leer el codigo de la ClabGalery?

Creo que ahi está la solución a tu problema, en los archivos (.as) :wink:

Por La100rra

Claber

5776 de clabLevel

11 tutoriales
4 articulos

Genero:Masculino  

Cd. Juárez, Chihuahua, México.

clabbrowser

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.