Load Var From Mysql Into Flash
I have the following code (flash.php)
<?
include "config_system.php";
include "idatabase.php";
include "ifunctions.php";
$connection = pg_connect( $connection_string ) or die ("Falha de Conexo ao Banco de Dados");
$sql_empresas = "SELECT * FROM empresas";
$query1 = exec_sql($connection,$sql_empresas);
$count_empresas = record_count($query1);
$sql_hh = "SELECT * FROM head_hunters";
$query2 = exec_sql($connection,$sql_hh);
$count_hh = record_count($query2);
$sql_vagas = "SELECT * FROM vagas";
$query3 = exec_sql($connection,$sql_vagas);
$count_vagas = record_count($query3);
?>
Empresas <? echo $count_empresas ?>
<br>
Head Hunters <? echo $count_hh ?>
<br>
Vagas <? echo $count_vagas ?>
Well, Id like to have $count_empresas, $count_hh and $count_vagas to be show in a flash movie
into a dynamic text field
called count_empresas, count_hh and count_vagas
How can I do that??
What is the code to do that??
Tkz ;)
[1107 byte] By [
rogernem] at [2007-11-19 2:42:34]

# 5 Re: Load Var From Mysql Into Flash
Hi
There is a beautilful code that you need to write into
the flash file..i.e you need to call the php file from flash
using the load_vars command which you will find like this
in flash
>>window>>actions>>
will open the action window
>> click + sign
>>ACtions>>browser/network>>
select loadvariable or geturl method to find the way out
thats it
happy coding..:_)
# 6 Re: Load Var From Mysql Into Flash
Best way to do it in my opinion is to make your php script output xml data. Then load the data using flashes xml parser.
Only do that if you are going to only pass the values in once, in which case passing the values on the query string is still easier. Flash's XML parser has a memory leak and if you parse XML repeatedly with it you will in short order hang the browser. The only reason I could see to take the trouble to output XML would be if you can find another use for the XML outside of Flash. But you will still need to watch out if you are going to fetch XML parse it, fetch XML parse it, etc... over and over. If you just want to pass a few paramters to flash, the query string method is the quickest and easiest way to get there.