all groups > flash data integration > april 2005 >
You're in the

flash data integration

group:

Flash & Php


Flash & Php djkearney
4/16/2005 12:00:00 AM
flash data integration: hello
having problems integrating flash & php. The results are coming into the php
file itself but having problems integrating these results into flash. I know
there is something needed inthe php script for the variable in the SWf. Could
anybody point me in the right direction. here is the php file:


<?php
// Make a MySQL Connection
mysql_connect("localhost", "dave", "") or die(mysql_error());
mysql_select_db("davedb") or die(mysql_error());

echo "Results for topics to date.<BR>";



$result = mysql_query("SELECT username FROM phpbb_users")
or die(mysql_error());



while($row = mysql_fetch_array( $result )) {

echo $row['username'];
}



?>
Re: Flash & Php djkearney
4/16/2005 12:00:00 AM
the code i have in flash is on a movieclip which has a dynamictextfield :

onClipEvent(load) {
loadVariables("forumresults.php",this,"GET");
}


Re: Flash & Php shellshock
4/24/2005 12:00:00 AM
you loadVaribles call is malformed there should be no GET in it

and your php echo should look more like
echo "var1=" . $row['username'];

you should try using the loadVars Class instead it's more flexable

you also want to make sure that the vars are finished loading before you try
to use them

if you want I can send you a very simple example of how to use the loadVars
class with php
Re: Flash & Php sly one
4/25/2005 12:00:00 AM
hey shellshock...
Re: Flash & Php somaboy mx
6/2/2005 8:46:20 PM
[quoted text, click to view]

It's not that difficult, you need to make the PHP script output the data
in name/value pairs, like this:

&var1=something&var2=something+else&var3something+different

and call the script from flash:

myPHP:LoadVars = new LoadVars();

myPHP.onLoad = function()
{
trace(this.var1); // outputs "something"
trace(this.var2); // outputs "something else"
trace(this.var3); // outputs "something different"
}

myPHP.load("myscript.php");

the variables var1, var2 and var3 will be available as properties of
your LoadVars object.

AddThis Social Bookmark Button