我似乎无法在任何地方找到符合我需求的线程,所以如果这已在其他地方得到回答,请指导我。
目前因为一个不应该发生的错误而把我的头发拉出来。我正在制作一个包含 XML 库的 flash 网站,就像我之前在很多很多项目中所做的一样(比如这个)。但是,当我加载 XML 文件时,出现以下错误:
Error #2044: Unhandled IOErrorEvent:. text=Error #2124: Loaded file is an unknown type.
这个项目与以前的项目唯一不同的是我在文档类编码中完成了这一切,但到目前为止这根本不是问题。我真的很困惑为什么 flash 不喜欢 XML 文件,我认为还有其他原因导致此错误出现,或者我没有导入某些内容,而不是 Flash 字面上无法识别文件类型。
以下是相关代码:
public function pg3_setup():void
{
trace("Page 3 setup in progress...");
p3_gallery_loader.load(new URLRequest("flash_scripts/gallery.xml"));
p3_gallery_loader.addEventListener(Event.COMPLETE,process_gallery);
function process_gallery(e:Event):void
{
trace("Gallery loaded");
var gallery_xml:XML = new XML(e.target.data);
image_list = gallery_xml.IMAGE;
number_of_images = image_list.length();
container_mask_width = bg.width - p_pad_left - p_pad_right;
create_container();
load_thumbs();
}
}
我从来没有使用过 process_gallery 函数,因此永远不会跟踪“已加载画廊”。对这个(可能很明显)问题的任何帮助都会很棒!
更新:可能还应该包括有问题的 XML,尽管据我所知,它与我用于此类事情的所有其他 XML 文件相同。
<?xml version="1.0" encoding="utf-8"?>
<GALLERY ROWS="1" WIDTH="25" HEIGHT="25">
<IMAGE FULL="full_images/I01.jpg" THUMB="thumbs/TI01.jpg" DES="PICTURE_1"/>
<IMAGE FULL="full_images/I02.jpg" THUMB="thumbs/TI02.jpg" DES="PICTURE_2"/>
<IMAGE FULL="full_images/I03.jpg" THUMB="thumbs/TI03.jpg" DES="PICTURE_3"/>
<IMAGE FULL="full_images/I04.jpg" THUMB="thumbs/TI04.jpg" DES="PICTURE_4"/>
<IMAGE FULL="full_images/I05.jpg" THUMB="thumbs/TI05.jpg" DES="PICTURE_5"/>
<IMAGE FULL="full_images/I06.jpg" THUMB="thumbs/TI06.jpg" DES="PICTURE_6"/>
<IMAGE FULL="full_images/I07.jpg" THUMB="thumbs/TI07.jpg" DES="PICTURE_7"/>
<IMAGE FULL="full_images/I08.jpg" THUMB="thumbs/TI08.jpg" DES="PICTURE_8"/>
<IMAGE FULL="full_images/I09.jpg" THUMB="thumbs/TI09.jpg" DES="PICTURE_9"/>
<IMAGE FULL="full_images/I10.jpg" THUMB="thumbs/TI10.jpg" DES="PICTURE_10"/>
<IMAGE FULL="full_images/I11.jpg" THUMB="thumbs/TI11.jpg" DES="PICTURE_11"/>
<IMAGE FULL="full_images/I12.jpg" THUMB="thumbs/TI12.jpg" DES="PICTURE_12"/>
<IMAGE FULL="full_images/I13.jpg" THUMB="thumbs/TI13.jpg" DES="PICTURE_13"/>
<IMAGE FULL="full_images/I14.jpg" THUMB="thumbs/TI14.jpg" DES="PICTURE_14"/>
<IMAGE FULL="full_images/I15.jpg" THUMB="thumbs/TI15.jpg" DES="PICTURE_15"/>
<IMAGE FULL="full_images/I16.jpg" THUMB="thumbs/TI16.jpg" DES="PICTURE_16"/>
<IMAGE FULL="full_images/I17.jpg" THUMB="thumbs/TI17.jpg" DES="PICTURE_17"/>
<IMAGE FULL="full_images/I18.jpg" THUMB="thumbs/TI18.jpg" DES="PICTURE_18"/>
<IMAGE FULL="full_images/I19.jpg" THUMB="thumbs/TI19.jpg" DES="PICTURE_19"/>
<IMAGE FULL="full_images/I20.jpg" THUMB="thumbs/TI20.jpg" DES="PICTURE_20"/>
<IMAGE FULL="full_images/I21.jpg" THUMB="thumbs/TI21.jpg" DES="PICTURE_21"/>
<IMAGE FULL="full_images/I22.jpg" THUMB="thumbs/TI22.jpg" DES="PICTURE_22"/>
<IMAGE FULL="full_images/I23.jpg" THUMB="thumbs/TI23.jpg" DES="PICTURE_23"/>
<IMAGE FULL="full_images/I24.jpg" THUMB="thumbs/TI24.jpg" DES="PICTURE_24"/>
<IMAGE FULL="full_images/I25.jpg" THUMB="thumbs/TI25.jpg" DES="PICTURE_25"/>
<IMAGE FULL="full_images/I26.jpg" THUMB="thumbs/TI26.jpg" DES="PICTURE_26"/>
<IMAGE FULL="full_images/I27.jpg" THUMB="thumbs/TI27.jpg" DES="PICTURE_27"/>
<IMAGE FULL="full_images/I28.jpg" THUMB="thumbs/TI28.jpg" DES="PICTURE_28"/>
<IMAGE FULL="full_images/I29.jpg" THUMB="thumbs/TI29.jpg" DES="PICTURE_29"/>
<IMAGE FULL="full_images/I30.jpg" THUMB="thumbs/TI30.jpg" DES="PICTURE_30"/>
<IMAGE FULL="full_images/I31.jpg" THUMB="thumbs/TI31.jpg" DES="PICTURE_31"/>
<IMAGE FULL="full_images/I32.jpg" THUMB="thumbs/TI32.jpg" DES="PICTURE_32"/>
</GALLERY>