PDA

View Full Version : another LoadVars problem



bmerens
September 27th, 2004, 07:52 AM
I try to get a variable from php :

I have a boutton with :

on (release) {

$myLoadVars = new LoadVars();
$myLoadVars_received = new LoadVars();

$myLoadVars.var_to_php = myComboBox.getSelectedItem().label;

$myLoadVars.sendAndLoad ( "script.php",$myLoadVars_received);

$affich_var = $envelope_received.var_from_php;
}

PHP //
script.php :

<?
$result = mysql_query( "select counter from data_base where data1='".$_POST['var_to_php']."'");

$counter = mysql_fetch_row($result);

echo ("&var_from_php=$counter[0]");
?>



=> my result of all this : nothing happens. no variable is received from php. ( the is no request ( from the firewall ) from flash to access the internet )

so I think the error is around the sendandload.

any suggestions ????

by the way, the php script works perfectly with loadVariablesNum


thanks for your help!

pom
September 27th, 2004, 09:55 AM
Salut,

What's $enveloppe_received supposed to be? It it's the data you want to receive, you'll have to declare an onLoad handler.

neverrain
September 27th, 2004, 09:58 AM
I'm not 100% sure this will work but, try the below code.


<?
$result = mysql_query( "select counter from data_base where data1=$_POST['var_to_php']");

$counter = mysql_fetch_row($result);

echo ("&var_from_php=$counter[0]");
?>

Also make sure your var (var_to_php) is successfully outputting from Flash.

virusescu
September 27th, 2004, 10:07 AM
i just did the tutorial with the $envelope_reieved var too :D
If you redefined your reciever LoadVar Object .. you should change with "$myLoadVars_received" everywere :), including in that line "$affich_var = $envelope_received.var_from_php;
"

bmerens
September 27th, 2004, 04:32 PM
ok ok !!!! i checked the AS and actually I have not $envelope but $affich_var = $myLoadVars_received.var_from_php;



reponse tu nerrain : there is no difference between my code and what you suggested !!!! or am I blind !!! ( oh my GOOD I might be blind !!! or behaps not :) )

any other solution ?

shall I " declare an onLoad handler" from Ilyas Premier
Motion Tween Guru ??? can anyone give me an exemple because I don't see what he means :(

thanks :)