0
在加載xml時,哪些代碼應該添加以顯示預加載器?或者我不需要有一個?AS3-XML如何在加載xml時執行預加載器?
//Load gallery.xml
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
xmlLoader.load(new URLRequest("gallery.xml"));
function LoadXML(e:Event):void
{
xmlData = new XML(e.target.data);
ParseProject(xmlData);
}
function ParseProject(projectInput:XML):void
{
trace("XML Output");
trace("------------------------");
var projectAttributes:XMLList = projectInput.project.attributes();
for each (var projectName:XML in projectAttributes)
{
trace(projectName);
var projectDP:XMLList = projectInput.project.(@name == projectName).displayP;
trace(projectDP);
}
}