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

Who is Participating?
blue-genieConnect With a Mentor Commented:
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.

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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.