-
anyone else hear that?
Loader issues
Alright, I've inherited someone else's code and everything seems to be working pretty good, but, sometimes (and it's not consistent), the pages that are loaded into the shell seem to "fail" while loading. On a faster connection, I have no problems. On a slow connection, the page will start loading, go up to a certain percent (different for different pages) and then stop. If I refresh the shell and go back to that page, it will stop at the same loading amount. If I re-upload the swf file to the server, it usually fixes itself. If I try to access that page from another machine, it doesn't freeze at the same point and, often, doesn't freeze at all. Can't consistently reproduce it or fix it, but it's making me crazy so, was wondering if anyone sees anything in the loading code that might cause that? Here it is:
Code:
var loader:Loader = new Loader();
var pcent:Number;
function loadLesson(slide:int){
CurrentSlide = slide;
unloadSwf();
loader.load(new URLRequest(Slides[CurrentSlide]));
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadProgress); loader.contentLoaderInfo.addEventListener(Event.COMPLETE,loadComplete);
}
function loadProgress(e:Event){
loading.visible = true;
pcent = (loader.contentLoaderInfo.bytesLoaded / loader.contentLoaderInfo.bytesTotal)*100;
loading.bar.scaleX = (loader.contentLoaderInfo.bytesLoaded / loader.contentLoaderInfo.bytesTotal);
if(Math.ceil(pcent)>1){
loading.perc.text = Math.ceil(pcent).toString() + "%";
}
}
Love like you've never been hurt, live like there's no tomorrow and dance like nobody's watching.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|