hmm
This is what I've used before when learning it from Kirupa
PHP: (varload.php)
PHP Code:
<?php
//These variables will store stuff from
//your database using sql query
$php1 = "Output1";
$php2 = "Output2";
$php3 = "Output3";
/*
add those variables to $var variable
using & so flash can read them
fla1,2,3 is the variable name used in flash
*/
$var = "&";
$var .= "fla1=" . $php1 . "&";
$var .= "fla2=" . $php2 . "&";
$var .= "fla3=" . $php3;
echo $var;
?>
Flash: (var.fla 3 text dynamic texts to store 3 fla variables fields)
PHP Code:
myVars = new LoadVars();
myVars.onLoad=function(success){
if(success){
//Converting from the php to flash variable to dynamic text
fla1.text = this.fla1; // "Output1"
fla2.text = this.fla2; // "Output2"
fla3.text = this.fla3; // "Output3"
err.text = "Variables Successfully Loaded."
} else {
err.text = "Error Loading Variables...";
}
}
//load page containing vars
myVars.load("http://domain.com/varload.php");
I'm not completely sure what the problem would be
but have you tried changing
echo "&returnVal=$vars";
to
echo "&returnVal=" . $vars;
and from what I gather
echo "&returnVal=$vars";
is going to be printing
text
text
text
as 1 string? (I'm not quite sure flash likes HTML like <br> while converting to flash)