Jump to content
Search Community

LoaderMax.parse() adding parameters to Array

bensbury test
Moderator Tag

Recommended Posts

Hi,

 

I've a CMS set up where the client can send various Media to my Flash movie which will use LoaderMax to pull in the content.

Sent with CMS data are a few details for determining position and so forth.

 

To allow for different Media types I am intending to use LoaderMax.parse() as in the documentation.

 

Looking at the array example, is it possible to set other LoaderMax properties like x position, width, height etc as part of the array?

 

Or how can I give LoaderMax a name/id for each url in the array so I can pick it up by name once it is loaded and use the name to reference my other information?

 

I searched about for LoaderMax.parse() information but couldn't find much beyond the example.

Any help or direction is greatly appreciated.

 

Thanks,

Ben.

Link to comment
Share on other sites

I think I have figured it out.

I'll leave my code for someone else who might also have been a bit unsure:

 

!the infoObj is my object that contains the CMS data with Content having the url.

So while not in the example below you can just add the custom properties to the append bit.

 

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

var cnt = infoObj.count;
		while (cnt -- ) {
		queue.append(LoaderMax.parse(infoObj[cnt].Content, {name:infoObj[cnt].Title}));
		}
//begin loading
		queue.load();

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