[問題] 請問 flash 與 php 之間變數的互傳
請教各位高手 @@
flash → php 我知道可以用 loadvariable
那 php → flash 通常都是用什麼方法呢?trace(變數名)嗎?
---------------------------------------------------------------------
我現在用的方法是
php端(將變數a傳進flash中):
$returnToFlash = "reply_txt=".$a;
echo mb_convert_encoding($returnToFlash, "UTF-8", "BIG5");
flash端:
_root.onData = function() {
trace(reply_txt); ps.我有放一個變數名為 reply_txt 的動態文字區塊
}
這樣可以順利接到1個變數
---------------------------------------------------------------------
但遇到的問題是 = = 我無法傳遞第 2 個變數,我改寫成
php端(將變數a,b傳進flash中:
$returnToFlash = "reply_txt=".$a; //印出分數
echo mb_convert_encoding($returnToFlash, "UTF-8", "BIG5");
$returnToFlash2 ="reply_txt2=".$b; //印出分數
echo mb_convert_encoding($returnToFlash2, "UTF-8", "BIG5");
flash端
_root.onData = function() {
trace(reply_txt);
trace(reply_txt2); ps.我有再加一個 reply_txt2 的動態文字區塊
}
----------------------------------------------------------------------
結果就發生傳第的第2個變數會接在第1個變數後面,都顯示在reply_txt的文字區塊裡了
可以請問我該怎麼改比較好嗎 ?
謝謝了 !!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.123.175.240
※ 編輯: divaka 來自: 140.123.175.240 (07/31 22:30)
※ 編輯: divaka 來自: 140.123.175.240 (07/31 22:41)
推
07/31 22:55, , 1F
07/31 22:55, 1F
推
07/31 23:10, , 2F
07/31 23:10, 2F
推
08/01 05:37, , 3F
08/01 05:37, 3F
推
08/03 23:03, , 4F
08/03 23:03, 4F
Flash 近期熱門文章
PTT數位生活區 即時熱門文章