Jump to content


Is there a way to configure settings for subloaded types?

Recommended Posts

I love how XMLLoader allows me to define additional assets to load within the XML file, but there is no way to override the default settings for each type, so I need to add the same properties over & over.


For example, I am loading 100's of sounds & videos for use on demand. If I don't set autoPlay=false on every single corresponding node, everything starts to play immediately, shattering my eardrums :-P


It would be good if we could set the default values for these properties on some global level. If the corresponding node is not found, the default for that type would be used.


SWFLoader.noCache = true;

ImageLoader.smoothing = true;

VideoLoader.autoPlay = false;


Having this capability would dramatically simplify the required content of the XML file.


Is there anything like this in the current system?

Link to comment
Share on other sites

Or, in keeping with the LoaderMax syntax, something more like:


VideoLoader.defaults = {noCache:true, autoPlay:false}

SWFLoader.defaults = {context:child, noCache:true}

Link to comment
Share on other sites

Actually, have you looked at the "childrenVars" special property that XMLLoader recognizes in <LoaderMax> nodes? Read the ASDocs at http://greensock.com/as/docs/tween/com/greensock/loading/XMLLoader.html Search the page for "childrenVars" and you should see it. I think that's almost exactly what you're looking for, right?

Link to comment
Share on other sites

  • 2 weeks later...

I think this will work. With this, I would need to have different LoaderMax nodes for each type of Loader, right?

Since I may want SWFLoaders to noCache=true but not ImageLoaders.

Link to comment
Share on other sites

Yep, if you need different children to have different settings, you'd need to group them into various LoaderMax nodes.

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.