有人请告诉我这个erorr是什么意思!?
erorr:
TypeError: Error #1090: XML parser failure: element is malformed.
at Function/Classes:Image_SS/$construct/Classes:processXML()[D:\*\Classes\Image_SS.as:73]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
代码(Image_SS.as):
function processXML(e:Event):void
{
var myXML:XML = new XML(e.target.data); <--- this is line 73 >>>>>>>>
if (where == "3D_solid_surface_1")
{
images = myXML.IMAGE_3D_solid_surface_1;
}
else if (where == "3D_solid_surface_2")
{
images = myXML.IMAGE_3D_solid_surface_2;
}
else if (where == "3D_solid_surface_3")
{
images = myXML.IMAGE_3D_solid_surface_3;
}
else if (where == "3D_solid_surface_4")
{
images = myXML.IMAGE_3D_solid_surface_4;
}
else if (where == "3D_solid_surface_closer_view")
{
images = myXML.IMAGE_3D_solid_surface_C;
}
image_figure = images.length();
myXMLLoader.removeEventListener(Event.COMPLETE, processXML);
myXMLLoader = null;
the rest of the code ...
}
XML代码:
<?xml version="1.0" encoding="utf-8"?>
<GALLERY>
<IMAGE_3D_solid_surface_1 FULL="Gallery/3D_solid_surface/1-1.jpg" THUMB="Gallery/3D_solid_surface/small/1-1.jpg"
<IMAGE_3D_solid_surface_1 FULL="Gallery/3D_solid_surface/1-2.jpg" THUMB="Gallery/3D_solid_surface/small/1-2.jpg"
<IMAGE_3D_solid_surface_2 FULL="Gallery/3D_solid_surface/2-1.jpg" THUMB="Gallery/3D_solid_surface/small/2-1.jpg"
<IMAGE_3D_solid_surface_2 FULL="Gallery/3D_solid_surface/2-2.jpg" THUMB="Gallery/3D_solid_surface/small/2-2.jpg"
<IMAGE_3D_solid_surface_3 FULL="Gallery/3D_solid_surface/3-1.jpg" THUMB="Gallery/3D_solid_surface/small/3-1.jpg"
<IMAGE_3D_solid_surface_4 FULL="Gallery/3D_solid_surface/4-1.jpg" THUMB="Gallery/3D_solid_surface/small/4-1.jpg"
<IMAGE_3D_solid_surface_4 FULL="Gallery/3D_solid_surface/4-2.jpg" THUMB="Gallery/3D_solid_surface/small/4-2.jpg"
<IMAGE_3D_solid_surface_C FULL="Gallery/3D_solid_surface/C_1.jpg" THUMB="Gallery/3D_solid_surface/small/C_1.jpg"
<IMAGE_3D_solid_surface_C FULL="Gallery/3D_solid_surface/C_2.jpg" THUMB="Gallery/3D_solid_surface/small/C_2.jpg"
<IMAGE_3D_solid_surface_C FULL="Gallery/3D_solid_surface/C_3.jpg" THUMB="Gallery/3D_solid_surface/small/C_3.jpg"
<IMAGE_3D_solid_surface_C FULL="Gallery/3D_solid_surface/C_4.jpg" THUMB="Gallery/3D_solid_surface/small/C_4.jpg"
<IMAGE_3D_solid_surface_C FULL="Gallery/3D_solid_surface/C_5.jpg" THUMB="Gallery/3D_solid_surface/small/C_5.jpg"
<IMAGE_3D_solid_surface_C FULL="Gallery/3D_solid_surface/C_6.jpg" THUMB="Gallery/3D_solid_surface/small/C_6.jpg"
<IMAGE_3D_solid_surface_C FULL="Gallery/3D_solid_surface/C_7.jpg" THUMB="Gallery/3D_solid_surface/small/C_7.jpg"
<IMAGE_3D_solid_surface_C FULL="Gallery/3D_solid_surface/C_8.jpg" THUMB="Gallery/3D_solid_surface/small/C_8.jpg"
</GALLERY>
我在其他地方使用了相同的代码并稍作改动。但这一次它不起作用。我不知道为什么!!!
答案 0 :(得分:1)
您忘记将结束标记添加到“IMAGE_3D_solid_surface_1”元素。
尝试这个新的XML代码:
<?xml version="1.0" encoding="utf-8"?>
<GALLERY>
<IMAGE_3D_solid_surface_1 FULL="Gallery/3D_solid_surface/1-1.jpg" THUMB="Gallery/3D_solid_surface/small/1-1.jpg" />
<IMAGE_3D_solid_surface_1 FULL="Gallery/3D_solid_surface/1-2.jpg" THUMB="Gallery/3D_solid_surface/small/1-2.jpg" />
<IMAGE_3D_solid_surface_2 FULL="Gallery/3D_solid_surface/2-1.jpg" THUMB="Gallery/3D_solid_surface/small/2-1.jpg" />
<IMAGE_3D_solid_surface_2 FULL="Gallery/3D_solid_surface/2-2.jpg" THUMB="Gallery/3D_solid_surface/small/2-2.jpg" />
<IMAGE_3D_solid_surface_3 FULL="Gallery/3D_solid_surface/3-1.jpg" THUMB="Gallery/3D_solid_surface/small/3-1.jpg" />
<IMAGE_3D_solid_surface_4 FULL="Gallery/3D_solid_surface/4-1.jpg" THUMB="Gallery/3D_solid_surface/small/4-1.jpg" />
</GALLERY>
答案 1 :(得分:0)
你的封闭标签在哪里?
<GALLERY>
<IMAGE_3D_solid_surface_1 FULL="Gallery/3D_solid_surface/1-1.jpg" THUMB="Gallery/3D_solid_surface/small/1-1.jpg"></IMAGE_3D_solid_surface_1>
<IMAGE_3D_solid_surface_1 FULL="Gallery/3D_solid_surface/1-2.jpg" THUMB="Gallery/3D_solid_surface/small/1-2.jpg"></IMAGE_3D_solid_surface_1>
<IMAGE_3D_solid_surface_2 FULL="Gallery/3D_solid_surface/2-1.jpg" THUMB="Gallery/3D_solid_surface/small/2-1.jpg"></IMAGE_3D_solid_surface_2>
<IMAGE_3D_solid_surface_2 FULL="Gallery/3D_solid_surface/2-2.jpg" THUMB="Gallery/3D_solid_surface/small/2-2.jpg"></IMAGE_3D_solid_surface_2>
<IMAGE_3D_solid_surface_3 FULL="Gallery/3D_solid_surface/3-1.jpg" THUMB="Gallery/3D_solid_surface/small/3-1.jpg"></IMAGE_3D_solid_surface_3>
<IMAGE_3D_solid_surface_4 FULL="Gallery/3D_solid_surface/4-1.jpg" THUMB="Gallery/3D_solid_surface/small/4-1.jpg"></IMAGE_3D_solid_surface_4>
<IMAGE_3D_solid_surface_4 FULL="Gallery/3D_solid_surface/4-2.jpg" THUMB="Gallery/3D_solid_surface/small/4-2.jpg"></IMAGE_3D_solid_surface_4>
<IMAGE_3D_solid_surface_C FULL="Gallery/3D_solid_surface/C_1.jpg" THUMB="Gallery/3D_solid_surface/small/C_1.jpg"></IMAGE_3D_solid_surface_C>
<IMAGE_3D_solid_surface_C FULL="Gallery/3D_solid_surface/C_2.jpg" THUMB="Gallery/3D_solid_surface/small/C_2.jpg"></IMAGE_3D_solid_surface_C>
<IMAGE_3D_solid_surface_C FULL="Gallery/3D_solid_surface/C_3.jpg" THUMB="Gallery/3D_solid_surface/small/C_3.jpg"></IMAGE_3D_solid_surface_C>
<IMAGE_3D_solid_surface_C FULL="Gallery/3D_solid_surface/C_4.jpg" THUMB="Gallery/3D_solid_surface/small/C_4.jpg"></IMAGE_3D_solid_surface_C>
<IMAGE_3D_solid_surface_C FULL="Gallery/3D_solid_surface/C_5.jpg" THUMB="Gallery/3D_solid_surface/small/C_5.jpg"></IMAGE_3D_solid_surface_C>
<IMAGE_3D_solid_surface_C FULL="Gallery/3D_solid_surface/C_6.jpg" THUMB="Gallery/3D_solid_surface/small/C_6.jpg"></IMAGE_3D_solid_surface_C>
<IMAGE_3D_solid_surface_C FULL="Gallery/3D_solid_surface/C_7.jpg" THUMB="Gallery/3D_solid_surface/small/C_7.jpg"></IMAGE_3D_solid_surface_C>
<IMAGE_3D_solid_surface_C FULL="Gallery/3D_solid_surface/C_8.jpg" THUMB="Gallery/3D_solid_surface/small/C_8.jpg"></IMAGE_3D_solid_surface_C>
</GALLERY>