Another LoadVars problem

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!

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.

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.

i just did the tutorial with the $envelope_reieved var too :smiley:
If you redefined your reciever LoadVar Object … you should change with “$myLoadVars_received” everywere :), including in that line “$affich_var = [color=red]$envelope_received[/color].var_from_php;

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 :slight_smile: )

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 :frowning:

thanks :slight_smile: