我在我的網站上創建了一個swf。 swf加載xml數據。當我在本地測試時它工作正常。但是當我將它上傳到服務器時,我得到一個IOErrorEvent()。爲什麼會發生?在我的網站上用swf加載XML文件時出現問題?
下面是XML文件的代碼:
<?xml version="1.0" encode="UTF-8"?>
<menu>
<col>///~~~~~~~~~~~~~~~~~~~~~~~
<tile>
///The "thumb" tag should indicate the corresponding image. It is an image.
///The "pic" tag indicates a partial web address. It is text
///The "cap" tag is used as an identifier caption. It is text.
<thumb>acquainted.jpg</thumb>
<pic>www.mysite.com</pic>
<cap>acquainted</cap>
</tile>
</col>///~~~~~~~~~~~~~~~~~~~~~~~
這裏是我的加載XML數據的代碼:
function xml1Loaded(e:Event):void {
menu1XML=new XML(xmlLoader1.data);
xmlLoader1.removeEventListener(Event.COMPLETE, xml1Loaded);
xmlLoader1.removeEventListener(IOErrorEvent.IO_ERROR, error1Occurred);
}
function error1Occurred(e:Event):void {
infoBox.text="There was an error loading an xml file. Perhaps the server is busy. Try refreshing the page.";
xmlLoader1.removeEventListener(Event.COMPLETE, xml1Loaded);
xmlLoader1.removeEventListener(IOErrorEvent.IO_ERROR, error1Occurred);
}
我怎樣才能找出是什麼原因造成這個錯誤?讓我瘋狂...從早上9點開始 - 早上5點試圖爲網站創建這個標題,現在我被困在XML加載錯誤...
編輯: 更正評論標記修復了我的xml加載問題。 然後我遇到了xml文件中沒有顯示在屏幕上的圖像。當我去www.mysite/media/myFlash.swf時,圖像完美加載;然而,當我去www.mysite.com那裏的'myflash.swf'在圖像中引發了另一個錯誤。 我通過更改xml中的文件路徑來更正此問題...而不是acquainted.jpg我將其更改爲media/specials/acquainted.jpg。
謝謝大家重定向我並幫助解決這些問題!
這些評論是否在你的xml中? ...因爲他們不是真的 – spender 2010-01-03 11:04:49