Hola!!! Estoy haciendo un visor de im谩genes en Flash y XML. Lo cierto es que no se mucho de programaci贸n, y he ido haciendo este c贸digo siguiendo algunos tutoriales de la red.
El visor funciona correctamente. El problema que encuentro es que si haces muchas veces clic en el bot贸n siguiente, se descontrola, empiezan a verse las im谩genes muy r谩pido, incluso se saltan algunos nodos... No se cual puede ser el problema, y mucho menos la soluci贸n. Os adjunto el c贸digo por si pod茅is echarme una mano. Much铆simas gracias de antemano. Alex - - - - - - - - - - - - - - - function loadXML(loaded) { if (loaded) { xmlNode = this.firstChild; image = []; description = []; total = xmlNode.childNodes.length; for (i=0; i<total; i++) { image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue; description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue; } firstImage(); } else { content = "imagen no cargada"; } } xmlData = new XML(); xmlData.ignoreWhite = true; xmlData.onLoad = loadXML; xmlData.load("referencias/images.xml"); ///////////////////////////////////// previous_btn.onRelease = function() { prevImage(); }; next_btn.onRelease = function() { nextImage(); }; ///////////////////////////////////// this.onEnterFrame = function() { filesize = picture.getBytesTotal(); loaded = picture.getBytesLoaded(); preloader._visible = true; if (loaded != filesize) { preloader.preload_bar._xscale = 100*loaded/filesize; } else { preloader._visible = false; if (picture._alpha<100) { picture._alpha += 10; } } }; function nextImage() { picture._alpha = 0; picture.loadMovie(image[i], 1); desc_txt.text = description[i]; } function prevImage() { if (i>0) { i--; picture._alpha = 0; picture.loadMovie(image[i], 1); desc_txt.text = description[i]; } } function firstImage() { if (loaded == filesize) { picture._alpha = 0; picture.loadMovie(image[0], 1); desc_txt.text = description[0]; picture_num(); } } function picture_num() { current_pos = i+1; pos_txt.text = current_pos+" / "+total; } -------------------------------------------------------------------- mail2web - Check your email from the web at http://mail2web.com/ . ---------------------------------- Lista ASNativos:asnativos@5dms.com http://www.5dms.com/listas ----------------------------------