En mi PC funciona hermoso, en el hosting no, cuando veo el php que genera el xml NO da ningún error y muestra todos los datos, pero el flash queda en blanco. Lo que carga es texto. Qué puede ser? Les dejo los códigos:
CALENDARXML.PHP
Código PHP :
<?php //header("Content-type: text/xml"); echo '<?xml version="1.0"?>'; include ("includes/config.php"); include ("includes/funciones.php"); $cnx = conectar(); $sql = "SELECT * FROM calendar ORDER BY id ASC"; $res = mysql_query($sql) or die("output=error&msg=".mysql_error()); if(mysql_num_rows($res) > 0) { echo "<calendar>"; //parseamos la información guardándola en $salida. while($fila = mysql_fetch_array($res)) { $salida.= "<fecha>"; $salida.= "<dia>" . $fila['fecha'] . "</dia>"; $salida.= "<correo>" . $fila['hora'] . "</correo>"; $salida.= "<cuerpo>" . utf8_encode($fila['lugar']) . "</cuerpo>"; $salida.= "<remitente>" . utf8_encode($fila['zona']) . "</remitente>"; $salida.= "</fecha>"; } //imprimimos la salida. echo $salida; echo "</calendar>"; //liberamos memoria mysql_free_result($res); //cerramos la conexión mysql_close($cnx); //detenemos la ejecucion de la pagina. exit; } ?>
ARCHIVO.FLA
Código ActionScript :
var myXML:XML = new XML(); myXML.ignoreWhite=true; myXML.load("http://localhost/rusconi/calendarxml.php"); myXML.onLoad = function(success) { if (success) { var myImage = myXML.firstChild.childNodes; for (i=0; i<myImage.length; i++) { var myImage2 = myXML.firstChild.childNodes[i].childNodes; dia = myImage2[0].firstChild.nodeValue; hora = myImage2[1].firstChild.nodeValue; lugar = myImage2[2].firstChild.nodeValue; zona = myImage2[3].firstChild.nodeValue; mitexto.html = true; mitexto.htmlText += dia + " " + hora + " " + " <b>" + lugar + "</b>" + " //" + zona; /* for (j=0; j<myImage2.length; j++) { var imageNumber = j+1; var imageURL = myImage2[j].firstChild.nodeValue; trace ("ID"+imageNumber+" : "+imageURL) mitexto.text += " " + imageURL; } */ mitexto.htmlText += "\n"; } } };
Gracias.
Salut y vita!
Emiliano