/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
import com.greensock.*; import com.greensock.loading.*; import com.greensock.events.LoaderEvent; var queue:LoaderMax = new LoaderMax({name:"mainQueue", onComplete: onQueueComplete /*,onProgress:progressHandler */ }); queue.append( new XMLLoader("site.xml", {name:"siteXml", onComplete: onXMLReady }) ); queue.load(); function onXMLReady(e:LoaderEvent):void { var self = e.currentTarget.content; for(var i in self.myNode){ var nodeContent = self.myNode[i]; trace(nodeContent); // queue.append( new SWFLoader(self.myNode[i].@swf, {onComplete: onSWFLoaded }) ); } } function onQueueComplete(e:LoaderEvent):void { trace("Loading Queue is Complete"); } /* function progressHandler(event:LoaderEvent):void { trace("progress: " + event.target.progress); } */