[問題] 請教php生成 xml給flash資料 的問題
我是個新手 有個php傳xml給flash的問題想請教 困擾好久
我在網路上找到了教學範例 從php 生成xml就叫aaa.xml 如以下
----------------php code 生成xml----------------------
<?php
header("Content-type: text/xml");
$xml_output = '<?xml version="1.0" encoding="UTF-8"?>';
$xml_output .= '<CLASSROOM>';
$xml_output .= '<TEACHER>';
$xml_output .= '<STUDENT ID="X001">Afro</STUDENT>';
$xml_output .= '<STUDENT ID="X002">Afrodsdf</STUDENT>';
$xml_output .= '</TEACHER>';
$xml_output .= '</CLASSROOM>';
echo $xml_output;
?>
--------------flash---------------------
然後 我在flash寫接xml資料 如以下
var myTextLoader:URLLoader = new URLLoader();
myTextLoader.load(new URLRequest("aaa.xml"));
myTextLoader.addEventListener(Event.COMPLETE, onLoaded);
function onLoaded(e:Event):void {
var bbb = XML(e.target.data);
trace (bbb)
}
-----------error-------------
就噴出錯誤了~~ 如以下
TypeError: Error #1092: XML 剖析器失敗:未結束的 XML 宣告。
at loadTest_fla::MainTimeline/onLoaded()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
想請教高手 我哪邊弄錯了呢? 我用的是AS3 player10
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.32.4.216
→
09/11 20:17, , 1F
09/11 20:17, 1F
→
09/11 23:41, , 2F
09/11 23:41, 2F
→
09/11 23:58, , 3F
09/11 23:58, 3F
推
09/12 05:35, , 4F
09/12 05:35, 4F
→
09/12 09:18, , 5F
09/12 09:18, 5F
→
09/12 09:19, , 6F
09/12 09:19, 6F
推
09/12 09:32, , 7F
09/12 09:32, 7F
→
09/12 09:39, , 8F
09/12 09:39, 8F
→
09/12 09:39, , 9F
09/12 09:39, 9F
→
09/12 09:40, , 10F
09/12 09:40, 10F
→
09/12 11:52, , 11F
09/12 11:52, 11F
→
09/12 11:53, , 12F
09/12 11:53, 12F
→
09/12 12:13, , 13F
09/12 12:13, 13F
Flash 近期熱門文章
PTT數位生活區 即時熱門文章