# Pagination with actionscript

**URL:** <https://forum.kirupa.com/t/pagination-with-actionscript/211322>\
**Category:** Uncategorized\
**Created:** [December 29, 2006, 10:13pm UTC](https://forum.kirupa.com/t/pagination-with-actionscript/211322 "2006-12-29T22:13:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ektorp](https://avatars.discourse-cdn.com/v4/letter/e/87869e/32.png) [@ektorp](https://forum.kirupa.com/u/ektorp)\
**Post date:** [December 29, 2006, 10:13pm UTC](https://forum.kirupa.com/t/pagination-with-actionscript/211322/1 "2006-12-29T22:13:11Z")

</div>

I have a simple script that attaches movie clips based on the number of items I have in my array. It currently spits out all of items in one long list. How, with actionscript, can I get my long list to paginate. I basically need it setup such that once I change a variable, that will control the number of items i see. Then i can click next or previous buttons to navigate thorugh the rest of my items. Any help with this would be greatly appreciated.

// ================  
// code below  
// ================

names =[  
“Mike”, “John”, “Bob”, “Chris”, “Peter”, “Steve”, “Jason”, “Paul”, “David”, “Brandon”, “Walter”, “Joe”, “Ariel”, “Teresa”, “Nancy”, “Jane”, “Brian”, “Patrick”, “Mark”, “Peter”, “Michelle”, “Michael”, “Richard”, “Jennifer”, “Jane”, “Doug”, “Jack”, “Allan”, “Nancy”, “Nick”, “Dylan”, “Sean”, “Julie”, “Jackie”, “Lisa”, “Donna”, “Vince”, “Ronald”, “Josh”, “Don”];

nameCount = names.length;

for(var i = 0; i \< nameCount; i++) {

var oInit:Object = new Object();  
oInit.\_x = 0;  
oInit.\_y = i \* 20;

item = listContainer.attachMovie(“nameItem”, “item” + i, i, oInit);  
item.label.text = names\*;  
}
