I have an old site developed in actionscript2 where I have to get some information from database in php.
I have tried to use SendAndLoad method but always returns undefined.
This my flash script:
news = new LoadVars();
news.onLoad = function(success){
if(success){
trace(this.msg);
} else {
trace("Error reading the php page");
}
}
news.sendAndLoad("json/news.php", news, "POST");
and this is news.php (only a test but not works always return undefined msg)
<?php
echo "login=false&";
echo "msg=missing data";
?>
How can I solve it?
Thanks
You need 2 LoadsVars. One for sending and one for receiving.
toSend.sendAndLoad(address, toRecieve, 'POST');