tengo un problemilla al cargar una imagen. Os pongo en situación, desde php creo un fichero xml, este contiene el nombre, descripcion, foto boton, altuar foto boton, ancho foto boton etc...
necesito hacer un boton por cada proyecto que haya a al base de datos.
xml:
Código :
echo"<?xml version='1.0' encoding='utf-8'?>"; echo"<contenidoXML>"; while($projecte=mysql_fetch_array($r)){ $nom = $projecte['nom']; $des = $projecte['descripcio']; $fotoButo = $projecte['imgButo']; $fotoFons = $projecte['imgFons']; $fotoDes = $projecte['imgDes']; $video = $projecte['video']; if( file_exists("../fotos/$fotoButo") ) { $sizefb = getimagesize("../fotos/$fotoButo"); } if( file_exists("../fotos/$fotoFons") ) { $sizeff = getimagesize("../fotos/$fotoFons"); } if( file_exists("../fotos/$fotoDes") ) { $sizefd = getimagesize("../fotos/$fotoDes"); } echo"<projecte>"; echo"<nom>$nom</nom>"; echo"<des>$des</des>"; echo"<fotoButo>$fotoButo</fotoButo>"; echo"<amplefb>$sizefb[0] </amplefb>"; echo"<altfb>$sizefb[1] </altfb>"; echo"<fotoFons>$fotoFons</fotoFons>"; echo"<ampleff>$sizeff[0] </ampleff>"; echo"<altff>$sizeff[1] </altff>"; echo"<fotoDes>$fotoDes</fotoDes>"; echo"<amplefd>$sizefd[0] </amplefd>"; echo"<altfd>$sizefd[1] </altfd>"; echo"<video>$vidoe</video>"; echo"<id>$projecte[id]</id>"; echo"</projecte>"; } echo"</contenidoXML>";
si ejecutamos el fichero php, funciona bien.
ahora el codigo de flash:
este carga el xml en una var:XML
Código :
var oxml:XML = new XML(); oxml.ignoreWhite = true; oxml.onLoad = function() { var rootNode = xmlDoc.firstChild; trace("Número de cotinguts: "+ oxml.firstChild.childNodes.length); for(i=0;i<oxml.firstChild.childNodes.length;i++) { contingut[i] = new Array(2); contingut[i][0] = oxml.firstChild.childNodes[i].childNodes[0].childNodes[0].nodeValue; contingut[i][1] = oxml.firstChild.childNodes[i].childNodes[1].childNodes[0].nodeValue; contingut[i][2] = oxml.firstChild.childNodes[i].childNodes[2].childNodes[0].nodeValue; contingut[i][3] = oxml.firstChild.childNodes[i].childNodes[3].childNodes[0].nodeValue; contingut[i][4] = oxml.firstChild.childNodes[i].childNodes[4].childNodes[0].nodeValue; contingut[i][5] = oxml.firstChild.childNodes[i].childNodes[5].childNodes[0].nodeValue; contingut[i][6] = oxml.firstChild.childNodes[i].childNodes[6].childNodes[0].nodeValue; contingut[i][7] = oxml.firstChild.childNodes[i].childNodes[7].childNodes[0].nodeValue; contingut[i][8] = oxml.firstChild.childNodes[i].childNodes[8].childNodes[0].nodeValue; contingut[i][9] = oxml.firstChild.childNodes[i].childNodes[9].childNodes[0].nodeValue; contingut[i][10] = oxml.firstChild.childNodes[i].childNodes[10].childNodes[0].nodeValue; contingut[i][11] = oxml.firstChild.childNodes[i].childNodes[11].childNodes[0].nodeValue; contingut[i][12] = oxml.firstChild.childNodes[i].childNodes[12].childNodes[0].nodeValue; trace("Contingut: "+ contingut[i][0] + " - "+ contingut[i][1]); } play(); }; /////////////////////// XML CARREGAT ////////////////////// contingut = new Array(); System.useCodepage = true; //Per Pillar Accents oxml.load("./xml/projectes.xml.php"); // == Online //oxml.load("http://localhost/intrusa/xml/noticies.xml.php"); // == Offline stop();
este en principio creo que si que va bien.
ahora el flash que imprime por pantalla:
Código :
posX = 200; posY = 75; altura = 0; //Per fer l'scroll for(i=0;i<contingut.length;i++){ attachMovie("txtNoticia", "txtInsertat"+i,i); objecte = this["txtInsertat"+i]; objecte.nom = contingut[i][0]; objecte.fotonom = contingut[i][2]; objecte.foto.foto.loadMovie("http:/localhost/intrusa/fotos/"+contingut[i][2]); objecte.foto.foto._xscale /= parseInt(contingut[i][3])/100; objecte.foto.foto._yscale /= parseInt(contingut[i][4])/100; altura += objecte._height + 10; objecte._x = posX; objecte._y = posY; posY+=objecte._height + 5; } stop();
creo que el problema esta en el loadMovie, que ruta hay que poner si estamos trabajando en localhost, y cuando lo ponga en el hosting, que ruta pondremos??? absolutas , relativas..



Muchas gracias y buenas noches