I want to calculate the parsing time....
package {
import flash.display.MovieClip;
import flash.net.URLLoader;
import flash.events.Event;
import flash.net.URLRequest;
public class Graph extends MovieClip
{
private var xmlFile:XML;
private var urlLoader:URLLoader = new URLLoader ;
public function Graph()
{
loadXML();
// constructor code
}
private function loadXML(file:String="xml/Employee.xml"):void
{
urlLoader.load(new URLRequest(file));
urlLoader.addEventListener(Event.COMPLETE,parseXML);
}
private function parseXML(ev:Event):void
{
xmlFi开发者_开发问答le = new XML(ev.target.data);
ParseTeam2(xmlFile.children()[0]);
}
function ParseTeam2(bookInput:XML):void
{
trace("XML Output");
trace("------------------------");
trace(bookInput);
}
}
}
var startTime:int = getTimer();
//parse xml...
trace("time passed: " + (getTimer() - startTime) + ", ms");
精彩评论