作者MrMarcus (请勿忘记密码)
看板Flash
标题Re: [问题] Flash接收PHP传送的变数
时间Sat Mar 14 02:40:32 2009
※ 引述《hic (~终日昏昏睡梦间~)》之铭言:
: 爬文看到这篇文章
: 但实际测试档案好像还是无法在flash抓到php要传的值
: 能否请懂得flash与php传值的板友
: 帮我看一下是哪个地方写错了呢?
: 谢谢
: 以下附上连结及程式码(大部分是复制zswolf/MrMarcus两位大大的文章内容)
: (以flash 8制作)
: http://tfgcamille.myweb.hinet.net/temp/test.rar
: [php内容]
: <?
: $a="Hic";
: $returnToFlash = "reply_txt=".$a;
: echo mb_convert_encoding($returnToFlash, "UTF-8", "BIG5");
: ?>
: [flash AS内容]
: var myEntries = new LoadVars();
: myEntries.load("http://localhost/test.php?=");
: myEntries.onData = function(success) {
^^^^^^
改成 onLoad
: if (success) {
: trace(this.reply_txt);
: //有放一个变数名为 reply_txt 的动态文字区块
: for(i in this) trace(i + '=' + this[i]);
: } else {
: reply_txt.text = "not yet";
: }
: };
: [输出结果]
: undefined
: onData=[type Function]
: ※ 引述《MrMarcus (请勿忘记密码)》之铭言:
: : [del]
: : 上面这行改成 trace(this.reply_txt); 才对。
: : 可以在这里加上下面这行检视接收到的资料:
: : for(i in this) trace(i + '=' + this[i]);
: : [del]
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 122.116.64.235
1F:推 hic:感谢你,这样就ok了 03/15 01:34