I’ve got a couple projects currently in production that require the pagination of data which has lead to PaginatorAS3. It’s a small controller/model for paginating data contained in a Array. Pagination seems to pop-up in a lot of ActionScript projects in a variety of forms, so I decided to formalize it into a flexible object. PaginatorAS3 contains no views, but takes care of all the data management in a clean simple implementation.
To create a new paginator you do the following:
paginator = new Paginator(myArray);
Then to retrieve the data set for a page you can do the following:
It supports 3 page scrolling types, NONE (see all pages), SLIDING (current page in the middle), and JUMPING (jumps by groups of pages), additionally you can control the number of pages to appear at one time. (NONE ignores this)
Below is a simple demo using the sliding scroll style.