Jump to content
Search Community

How to loop trough the ImageLoaders in XML

Hulio test
Moderator Tag

Recommended Posts

Ok, it's monday and I think I should know this better, but I just can't.

 

How do I loop all the ImageLoaders at once under the LoaderMax -node in XML? Somehow I just can't get the lenght fetched no matter what I do...

 

Here's what I'm trying to do:

 












 

var xml_preload_images = preloader.getContent("general_images");

for (var i : int = 0; i <= xml_preload_images.lenght; i++) {...

 

 

Thnks!

Link to comment
Share on other sites

the "content" of a LoaderMax will be an array of all the child loaders' content (in your case, a bunch of images...well, actually ContentDisplay objects that contain the images). If you want the loaders themselves, just use the getChildren() method of the LoaderMax instance like:

 

var queue:LoaderMax = LoaderMax.getLoader("general_images") as LoaderMax;
var imageLoaders:Array = queue.getChildren();

for (var i : int = 0; i

 

Does that help?

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...