# Paging through XML file

**URL:** https://forum.kirupa.com/t/paging-through-xml-file/179468
**Category:** Uncategorized
**Created:** [February 20, 2006, 2:29pm UTC](https://forum.kirupa.com/t/paging-through-xml-file/179468 "2006-02-20T14:29:15Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Flokke](https://avatars.discourse-cdn.com/v4/letter/f/c67d28/32.png) [@Flokke](https://forum.kirupa.com/u/Flokke)
#### Post date: [February 20, 2006, 2:29pm UTC](https://forum.kirupa.com/t/paging-through-xml-file/179468/1 "2006-02-20T14:29:15Z")

</div>

Hi

I retreive data from an XML file. (title + link on title to external site).  
The amount of titles (with link) can vary.  
What I would like to do is display 10 titles at a time with, if more than 10 records, a next 10 button (and previous 10 button).

Showing all the records is not a problem just as showing the first 10 records. But my ‘next’ button is not working…

I hope anyone can help, Thx in advance.  
Flokke

Hereby my code:

var item\_spacing = 15;  
var item\_count = 0;  
var i = 0  
var a = i + 10  
bt\_volgende.\_visible = false;  
function CreateMenu(menu\_xml){

var items = menu\_xml.firstChild.childNodes;  
nodes array  
var aantal = items.length

for (i; i\<a; i++) {  
var item\_mc = menu\_mc.attachMovie(“menu\_item”,“item”+item\_count, item\_count);  
item\_mc.\_y = i \* item\_spacing;  
item\_count++;  
trace(i);

var titel = items\*.firstChild; // same as items\*.childNodes[0]  
var adres = items\*.childNodes[1]; // second child node

item\_mc.titel\_txt.text = titel.firstChild.nodeValue;  
item\_mc.main\_btn.adres\_text = adres.firstChild.nodeValue;

item\_mc.main\_btn.onRelease = function() {  
getURL(this.adres\_text, “\_blank”);  
}

if (i \< aantal) {

bt\_volgende.\_visible = true;  
bt\_volgende.onRelease = function() {  
i = a;  
a = a+10;  
}

}  
}  
}

var squirrel\_xml = new XML();  
squirrel\_xml.ignoreWhite = true;  
squirrel\_xml.onLoad = function(success){  
if (success) CreateMenu(this);  
else trace(“Error loading XML file”);  
}  
squirrel\_xml.load(“squirrel\_finder2.xml”);
