Re: [問題] Flash接收PHP傳送的變數

看板Flash作者 (請勿忘記密碼)時間16年前 (2009/03/14 02:40), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串4/4 (看更多)
※ 引述《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

03/15 01:34, , 1F
感謝你,這樣就ok了
03/15 01:34, 1F
文章代碼(AID): #19kgYXjT (Flash)
文章代碼(AID): #19kgYXjT (Flash)