Changing the XML File

Discussions about the Carousel component.

Changing the XML File

Postby andrew on Mon Mar 08, 2010 9:47 pm

Hey, I'm planning on using this for a loading screen for users, and I need the carousel have different images for each user. So I'd like to create a new xml file for each user, but how do I set the carousel to look in a different location for the xml file each time I call it? As far as I can tell, you set a static location for the file. Thanks for the help.
andrew
 
Posts: 6
Joined: Mon Mar 08, 2010 9:45 pm

Re: Changing the XML File

Postby David on Tue Mar 09, 2010 12:28 am

If I understand you correctly, you want to have multiple XML files and each time the carousel loads you want it to load a random XML file from a list of XML files available.
In this case, try this code:

Code: Select all
var list:Array = ["one.xml", "two.xml", "three.xml", "four.xml"];

var random:int = Math.floor(Math.random() * list.length);
carousel.xmlPath = list[random];
David
Site Admin
 
Posts: 345
Joined: Tue Nov 04, 2008 4:38 pm

Re: Changing the XML File

Postby andrew on Tue Mar 09, 2010 3:53 pm

That's actually not what I meant, but I figured it out anyway, so thanks for the help!
andrew
 
Posts: 6
Joined: Mon Mar 08, 2010 9:45 pm

Re: Changing the XML File

Postby David on Tue Mar 09, 2010 10:57 pm

Ok then, glad you've got it working.
David
Site Admin
 
Posts: 345
Joined: Tue Nov 04, 2008 4:38 pm


Return to Carousel

Who is online

Users browsing this forum: No registered users and 1 guest

cron