2006/04/12 | Flash和php通讯
类别(Flash&AS2) | 评论(0) | 阅读(329) | 发表于 14:02
今天研究了一下Flash和php的通讯,感觉很简单,和asp差不多。
//Flash接受php参数代码:
var sendLoad:LoadVars = new LoadVars();
var acceptLoad:LoadVars = new LoadVars();
sendLoad.sendAndLoad("HelloWorld.php", acceptLoad, "POST");
acceptLoad.onLoad = function(s) {
  var myText = _root.createTextField("Billows", 0, 100, 100, 100, 100);
  myText.text = this.userName;
};
//php代码:
<HTML>
<HEAD>
<TITLE>
<?
echo "Hello World!";
?>
</TITLE>
</HEAD>
<BODY>
<H1>
First PHP page
</H1>
<HR>
<?
// Single line C++ style comment
/*
printing the message
*/
echo "Hello World!";
$ a = "Billows";
//echo "&data=".urlencode(success)."&";
echo "&data=".urlencode($ a)."&";
# Unix style single line comment
?>
</BODY>
</HTML>
容易吧,再研究一下,过两天再来个php接受Flash参数的.
对了php的运行环境是IIS+php安装程序,网上很多的,我也是从网上找的:)
0

评论Comments

日志分类
首页[116]
Flash&AS2[56]
FMS[3]
Flex&AS3[5]
Asp[5]
My Works[13]
My Life[34]