El archivo php es el siguiente:
Código :
<?php
include ("gestion/conexion.php");
$sql = "SELECT * FROM noticias ORDER BY id DESC LIMIT 0,5";
$consulta = mysql_query($sql,$conexion);
$nrows = mysql_num_rows($consulta);
mysql_close();
$respuesta="";
$i=0;
while ($row = mysql_fetch_array($consulta)){
$respuesta.= "&id$i=".$row["id"];
$respuesta.= "&titulo$i=".substr ($row["titulo"],0,60);
$respuesta.= "&fecha$i=".date("d-m-Y", strtotime($row['fecha']));
$respuesta.= "&foto$i=".$row['foto'];
$i++;
}
$respuesta.="&";
echo utf8_encode($respuesta);
?>
El código flash, que está en el primer fotograma es el siguiente:
Código :
var archivoPHP:LoadVars = new LoadVars();
archivoPHP.load("obtenerActualidad.php");
archivoPHP.onLoad = function (exito:Boolean){
if (exito){
texto1.htmlText+= "<span class='fecha-noticias'>"+this["fecha"+0]+"</span><br><class='texto-noticias'>"+this["titulo"+0]+"</span>";
_root.pantalla_mc.loadMovie("gestion/"+this["foto"+0]);
_root.pantalla_mc._width = 544;
_root.pantalla_mc._height = 363;
} else{
texto1.htmlText="Error al cargar datos";
}
};
El problema es que quiero llamar a otra página php, enviándole la "id" de la noticia seleccionada, y siempre me dá error. Lo que quiero es enviar la variable al php y mostrar la página, sin necesidad de volver al flash. Para ello utilizo:
Código :
_root.boton1.onRelease = function (){
getURL("prueba.php?id="+this["id"+0]);
}
Si alguien me puede ayudar se lo agradecería porque no doy encontrado el error.
Para recojer la variable en el php utilizo $_GET['id']
