Para comunicar flash con mysql utilizo el siguiente php :
Código :
<?php
$host = 'localhost';
$user = 'usuario';
$pass = 'password';
$db = 'basedatos';
mysql_connect($host,$user,$pass);
mysql_select_db($db);
$tot = 5; # numero de noticas a visualizar
$i = 0; # determinamos el índice
$query = "SELECT id,titulo,texto,url,DATE_FORMAT(fecha, '%d.%m.%Y') as newData
FROM news
ORDER by data desc
LIMIT 0,$tot";
$result = mysql_query($query);
$output = 'tot='.mysql_num_rows($result);
while($news = mysql_fetch_array($result))
{
$output .= '&fecha'.$i.'='.$news['newData'];
$output .='&tituo'.$i.'='.urlencode($news['tituo']);
$output .='&texo'.$i.'='.urlencode(substr($news['texo'],0,200));
$output .='&url'.$i.'='.urlencode($news['url']);
$i++;
}
echo $output;
?>
Ahora bien, todo el contenido (fecha, titular, noticia y url ) va a para a la misma caja de texto (txtNews), por lo que quiero saber como establecer el vínculo para la linea de url, y que al pinchar abra en ventana aparte.
El AS del frame es el siguiente ;
Código :
stop();
function News() {
if (i == news.tot) {
i = 0;
}
txtNews.htmlText = '<i>'+news["fecha"+i]+'</i><br />';
txtNews.htmlText += '<b>'+news["titulo"+i]+'</b><br />';
txtNews.htmlText += news["texto"+i];
// Supongo que tendría que añadirle el <a href> por algún lado, pero no entiendo bien la sintaxis
txtNews.htmlText += '<b>'+news["url"+i]+'</b><br />';
i++;
}
News();
time(fadeIn);
Saludos.
