如何通过动作脚本中的getURL与PHP交互?

时间:2010-02-08 08:45:56

标签: php actionscript geturl

getURL('http://www.google.com',_blank);

以上可以打开google.com,但如何从localhost上的服务器端(PHP)获取数据?

1 个答案:

答案 0 :(得分:1)

我找到了这个教程

<?
$first="this";
$second = "that";

echo "myfirst=$first&mysecond=$second";
exit;
?>

Flash动作脚本:

var lvSend = new LoadVars();
var lvReceive = new LoadVars();
lvSend.SendAndLoad("www.domain.com/script.php",lvReceive,"POST");

lvReceive.onLoad = function(bSuccess) {
if(bSuccess == true) {
trace(this.myfirst);
trace(this.mysecond);
}
}