I am calling several external scripts in my app using the URLLoader. These
calls return xml data.

I am trying to display the progress of the data flow using the
event.Progress as follows but I am not getting very good results. It is
currently displaying the following.

Loaded: 349
Total: 0
Percent Infinity

Perhaps this is not possible?

_loader.addEventListener(ProgressEvent.PROGRESS, handleProgress);
var request:URLRequest = new URLRequest(scriptPath);
request.method = URLRequestMethod.POST;
                        
var variables:URLVariables = new URLVariables();                        
variables.xml = dataToSend;             
                        
request.data = variables;                       
_loader.load(request);  

----

private function handleProgress(event:ProgressEvent):void {

                                
        var percent:Number = Math.round(event.bytesLoaded / event.bytesTotal
* 100);
                        
        _sessionInstance.progressTxt = "Loaded: " + event.bytesLoaded + "\n"
+ " Total: " + event.bytesTotal + "\n" + "Percent " + percent;
                        
}

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to