I know you've already found it, but here is some sample code:
public var dataRequest:URLRequest;
public var dataLoader:URLLoader;
public var allowCache:Boolean;
dataLoader = new URLLoader();
dataLoader.addEventListener(Event.COMPLETE, onComplete);
dataLoader.addEventListener(ProgressEvent.PROGRESS, onProgress);
dataLoader.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
dataLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);
dataLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS, onHTTPStatus);
dataRequest = new URLRequest();
dataRequest.url = "xmlfilelocation.xml" + ((this.allowCache) ? "" : "?cachekiller=" + new Date().valueOf());
dataLoader.load(dataRequest);
public function onComplete(event:Event):void{
trace("onComplete");
}
public function onProgress(event:ProgressEvent):void{
trace("onProgress");
}
public function onIOError(event:IOErrorEvent):void{
trace("onIOError");
}
public function onSecurityError(event:SecurityErrorEvent):void{
trace("onSecurityError");
}
public function onHTTPStatus(event:HTTPStatusEvent):void{
trace("onHTTPStatus");
}
I like to add the "allowCache" because Flash/Flex is terrible about caching stuff like this when you don't want it to.