Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simplist AS2 XML preloader 1

Status
Not open for further replies.

Leozack

MIS
Oct 25, 2002
867
GB
I thought it was about time I put a preloader on my project incase the xml file gets too big. However, it stumped me though and now I've come back to it I'm still stumped!

I've found various little tutorials and the most basic ones use the same principal as an image loader eg
Code:
onEnterFrame = function(){
    var todo:Number = myxml.getBytesTotal();
    var done:Number = myxml.getBytesLoaded();
    
    if(todo == done){
        trace("XML LOADED");
        delete onEnterFrame;
    } else {        
        if(todo){
            trace("XML " + String(Math.round(100 / todo * done)) + "%");
        }
    }
}
But basically the best I get with the various methods is nothing happens while it's loading then a 'finished' when it's done (no update calls are made, no % is shown etc) and I can't get round this.

I'm turning it over to you smart people as I'm sure you've got a simple method like that which actually works, and which I can figure out how to impliment into my project where it's not sat on the _root/this. timeline/object etc.

I'm using Flash MX (6) / AS2

_________________________________
Leozack
Code:
MakeUniverse($infinity,1,42);
 
I thought that was MX2004 only stuff for a second ;) But the keywords there were LOCAL DISK ... I hadn't run the tests through using apache or anything and now I have the bar is fine ^_^ Thanks ... not sure why I didn't come accross "only works when not running on local files without http hosting" ... though maybe that's just the same for images and movies and everything else preloading and I've forgotten >_>'

_________________________________
Leozack
Code:
MakeUniverse($infinity,1,42);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top