Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 11-24-2009, 03:53 PM   #1
ThickGraphics
Registered User
 
Join Date: Feb 2009
Posts: 41
Default loading progress problem

the file loads but the progress of the load isn't tracing.

Code:
var urRequest:URLRequest = new URLRequest('http://www.focusonmedia.com/vqs/as3/externaltext.txt');

var ulLoader:URLLoader = new URLLoader();

ulLoader.addEventListener(ProgressEvent.PROGRESS,loaderProgressHandler);
ulLoader.addEventListener(Event.COMPLETE,loaderCompleteHandler);

function loaderProgressHandler(evt:ProgressEvent):void {
	var bLoaded:Number = evt.target.bytesLoaded;
	var bTotal:Number = evt.target.bytesTotal;
	trace(bLoaded + '/' + bTotal + 'has loaded');
}

function loaderCompleteHandler(evt:Event):void {
	trace(evt.target.data);
}

ulLoader.load(urRequest);
ThickGraphics is offline   Reply With Quote
Old 11-24-2009, 09:31 PM   #2
creynders
flash veteran
 
creynders's Avatar
 
Join Date: May 2005
Location: Belgium
Posts: 914
Default

How have you tested this?
If only in the Flash IDE, then it's because the txt file is loaded too quickly and it doesn't have time to register the progress.
The code seems fine, so I think that's the problem.
If you want to test how it would look on a slow connection you can use a webproxy (for instance Charles: http://www.charlesproxy.com/ ) to throttle and simulate a different download speed.
creynders is offline   Reply With Quote
Old 12-03-2009, 01:59 AM   #3
ThickGraphics
Registered User
 
Join Date: Feb 2009
Posts: 41
Default

i understand that the progress of the load may be to quick to see, but there should be a trace statement of the size of the file right?
ThickGraphics is offline   Reply With Quote
Old 12-03-2009, 06:57 AM   #4
creynders
flash veteran
 
creynders's Avatar
 
Join Date: May 2005
Location: Belgium
Posts: 914
Default

Quote:
Originally Posted by ThickGraphics View Post
i understand that the progress of the load may be to quick to see, but there should be a trace statement of the size of the file right?
No, not necessarily. Typically it'll just execute the 'loaderCompleteHandler' method.
creynders is offline   Reply With Quote
Old 12-08-2009, 03:51 PM   #5
ThickGraphics
Registered User
 
Join Date: Feb 2009
Posts: 41
Default

ok, thank you.
ThickGraphics is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:17 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.