flash变量如何传递给php?

来源:百度知道 编辑:UC知道 时间:2024/05/17 08:52:19

不给分吗?
方法一:
要想提供可供flash使用的变量,必须符合标准的MIME格式:
(1)变量和其值之间用等号连接
(2)变量名之间用&分隔
(3)不能有空格(变量值得空格用+代替)
注:如果用相对路径的话,这个swf文件一定得处于一个活动的php页面中。
code of test.php:
<?php
$output = "var1=111&var2=222&var3=333";
echo $output;
?>
code of frame action:
loadvar = new LoadVars();
loadvar.onLoad = function(success) {
if (success) {
trace(this.var1);
trace(this.var2);
...
}
}
loadvar.load('http://127.0.0.1/test.php");//这里用的是绝对路径
方法二:
code of test.php:
<?php
$myText = "Hello world! I am <b>Bold</b> and she is <i>Italics</i>";
echo $myText;
?>::::: code of frame action:
myVars = new LoadVars();
myVars.onData = function(src) {
myTextField.htmlText = src;
}
myVars.load("test.php&qu