XML, Xmllist and pagination

Hi there

I have a flash project which loads external data from XML documents. One contains information on PDF downloads that the site offers, each download has various attributes.

There is not enough room to include all these Download items on one page so I need to offer pagination. My issue come where I would like to dynamicly create the 'x' number of mc's required and populating them with the correct items!

I have tried loads of options but can't seem to find a solution. I have looked at creating a pages array which holds x number of pages items which each contain a set of objects required for that page! This works, and I can easily get the number of pages required dynamicly from the whole XML list but I can't work out how to split up the XML into chunk of 'x' items and adding them to this pages array?

Can anyone suggest the way to extract/ split up this info into the required format?

Or perhaps suggest a better way to tackle this, i am fairly new to as3 programming and am probably missing something very obvious.

Many thanks for your time


S
LVL 1
socrossAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

blue-genieCommented:
hello, i'm not going to do this for you (maybe someone else will) but i'll give you some pointers.

'"x' number of mc's required " - what are you trying to achieve here (visually)?

first of all i'm assuming you've successfully loaded your xml into your flash.
ok so once your xml is loaded you want to check how many items there are.
so say you've loaded your xml into xml object
depending on your xml structure you want to check how many items there are.

so e.g xml.pages.length(); returns you 15;
then you decide you can fit 4 items on a page.

so total number of pages required will be Math.ceil(15/4);  which is equal to 4.

so you can use a loop to add thumbnails or whatever it is to do that.
you can also add a page counter to check 1 of 4, 2 of 4 etc.

blu.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
socrossAuthor Commented:
Thanks for your pointers blue genie.

By mentioning a page counter you got me thinking a bit more clearly! All sorted by keeping track of the total page, current page! Thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.