Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    234
  • comments
    427
  • views
    115138

Flash XML Loader

Sign in to follow this  
Battagline

238 views

I'm working on a Flash XML Level loader, and I'm running in to some problems.


function LoadLevel( level:Number ) {
level_xml = new XML();
level_xml.ignoreWhite = true;
level_xml.onLoad = function(success) {
if (success) {
trace('Author.xml loaded. Contents are: '+this.toString());
}

};
level_xml.load( 'Level1.xml' );
trace( 'getBytesLoaded=' + level_xml.getBytesLoaded() );
while( level_xml.getBytesTotal() == undefined ||
level_xml.getBytesLoaded() == undefined ||
level_xml.getBytesTotal() > level_xml.getBytesLoaded() ) {
trace( 'pct=' + Math.ceil( level_xml.getBytesLoaded() / level_xml.getBytesTotal() * 100 ) );
}
trace( 'pct=' + Math.ceil( level_xml.getBytesLoaded() / level_xml.getBytesTotal() * 100 ) );
var level_node:XMLNode = level_xml.firstChild;
trace('level_node.nodeName=' + level_node.nodeName );
}


my calls to the methods getBytesLoded() and getBytesTotal() are returning NaN. I'm not exactly sure what's going on with that.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!