Jump to content
Search Community

Custom LoaderMax-related nodes inside XML

waq177 test
Moderator Tag

Recommended Posts

I was thinking it would be nice to have a way to inject custom xmlNode names into a loaderMax instance. Many devs already have a defined xml spec for their project. It'd be nice not to have to rewrite them with , , etc nodes.

 

Some kind of method that accepts a loaderMax type and an array of nodes that should be mapped to it:

 

var queue:LoaderMax = new LoaderMax({name:"mainQueue", auditSize:true, onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler});

 

tempArray = new Array(graphic, thumbnail, hiRez, icon) // these are the custom nodes

 

queue.mapCustomNodes(ImageLoader, tempArray) //tell loaderMax to search the xml file for these nodes as well

 

queue.append( new XMLLoader("xml/data.xml", {name:"xmlDoc"}) );

Link to comment
Share on other sites

Hmm, while I see why it could be convenient to do this sort of thing, I think it creates some other issues that I'm not comfortable with. I think it is much cleaner if there is an accepted, "standard" way to write XML for LoaderMax. Specifically, having the node names match the class names ( for ImageLoader, etc.) Once I introduce the ability to customize the tag names, it becomes more difficult for developers to not only read/identify the necessary XML info, but it could create confusion as well where they forget to activate custom stuff and get frustrated when it appears to "work" on one site/project but not another. And XMLLoader must look for a standard set of attributes too, so the only thing that could be customized anyway are the actual node names. So if you'd have to conform your XML to all those attribute names anyway, it's not like it's a huge step to name the node appropriately. See what I mean?

Link to comment
Share on other sites

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...