Cargo "Nombre", "descripcion" y "link" desde el php, pero cuando no tengo datos cargados de el link... me aparece lo mismo el link, hay forma de mostrar solo los datos q estan cargados?? ademas, como en flash el link no me funcionaba le agregue en php el "http://" eso es lo q me muestra cuando no hay datos por q lo mismo lo envia. Aver si alguien me puede ayudar. gracias.
Agrego los sript
Código :
Código ActionScript :
var fuente:LoadVars = new LoadVars(); var texto:TextField; fuente.load("articulobd.php"); texto.html = true; texto.wordWrap = true; texto.multiline = true; fuente.onLoad = function (exito:Boolean){ if (exito){ texto.htmlText=""; for (var i:Number=0; this["id"+i]!=undefined;i++){ texto.htmlText+= "<p><b>"+this["nombre"+i]+"</b></p><br>"; texto.htmlText+= "<p align='right'><i>"+this["descripcion"+i]+"</i></p><br>"; texto.htmlText+="<p><b>Link: </b><u><a href=\""+this["link"+i]+"\" target=\"_blank\">"+this["link"+i]+"</a></u></p><br><br>"; } } else{ managerError("fuente"); } } function managerError(name:String){ texto.htmlText = "No se pudo cargar las noticias"; trace("En "+name+" no se puede cargar el archivo fuente"); } manager();
Código :
Código PHP :
<?php $HOST = "localhost"; $USER = ""; $PASS = ""; $DATABASE = ""; $conex = mysql_connect($HOST, $USER, $PASS); mysql_select_db($DATABASE, $conex); $sql = "SELECT * from ...... order by fecha DESC"; $result = mysql_query($sql); mysql_close(); $respuesta=""; $i=0; while ($row = mysql_fetch_array($result)){ $respuesta.= "&id$i=".$row['idnovedad']; $respuesta.= "&nombre$i=".$row['nombre']; $respuesta.= "&link$i="."http://".$row['link']; $respuesta.= "&link2$i=".$row['link2']; $respuesta.= "&descripcion$i=".utf8_encode($row['descripcion']); $respuesta.= "&lugar$i=".$row['lugar']; $respuesta.= "&fecha$i=".$row['fecha']; $i++; } $respuesta.="&"; echo utf8_encode($respuesta); mysql_free_result($result); mysql_close($cnx); ?>