Flash + PHP (sistema de atualizacao de noticias)
Olá,
estou tendo problemas em fazer o flash carregar uma pagina externa em PHP.
O PROBLEMA
Estou montando um site e estou tentando fazer um sistema de atualizacao de noticias pelo Admin. Fiz um banner com noticias rotatórias pelo flash que até entao estava com imagens e nao textos, e estava sendo trabalhoso a atualizacao, pois tinha que mandar novas imagens toda hora. Para isso estamos tentando fazer essa interacao direta do Flash com o PHP. Só que como nao tenho muita nocao de linguagem PHP estou meio perdido. Dei uma procurada na internet e vi topicos de LoadVars e URLLoader, mas nao consigo fazer fucionar de jeito nenhum.
fiz um teste com esse codigo
_root.createTextField("nome_txt",0,0,0,200,20);
var objRecebe:LoadVars = new LoadVars();
objRecebe.onLoad = function():Void {
nome_txt.text = objRecebe.nome;
}
objRecebe.load("[http://www.measurefiles.com.br/camarabuzios/noticia_php_flash.php"](http://www.measurefiles.com.br/camarabuzios/noticia_php_flash.php));
mas quando carrega aparece undefined
Dai se eu faço esse teste com um php simples, funciona, mas se eu uso o que existe que é esse abaixo, nao funciona
<?php require_once('Connections/measure_camara.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_measure_camara, $measure_camara);
$query_RsListaDestaque = "SELECT pd_id, pd_titulo, pd_status, pd_destaque, pd_data, pd_nome FROM pg_detalhe WHERE pd_destaque = 1 and pd_status = 1 ORDER BY pd_data DESC LIMIT 3";
$RsListaDestaque = mysql_query($query_RsListaDestaque, $measure_camara) or die(mysql_error());
$row_RsListaDestaque = mysql_fetch_assoc($RsListaDestaque);
$totalRows_RsListaDestaque = mysql_num_rows($RsListaDestaque);
do {
echo $row_RsListaDestaque['pd_nome']."<br />";
} while ($row_RsListaDestaque = mysql_fetch_assoc($RsListaDestaque));
mysql_free_result($RsListaDestaque);
?>
Alguem poderia me dar uma luz?
Agradecido,
Leo
Discussão (3)
Carregando comentários...