# Squirrel Finder pages

**URL:** <https://forum.kirupa.com/t/squirrel-finder-pages/153630>\
**Category:** flash\
**Created:** [July 3, 2005, 6:05am UTC](https://forum.kirupa.com/t/squirrel-finder-pages/153630 "2005-07-03T06:05:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![iMat](https://avatars.discourse-cdn.com/v4/letter/i/bbce88/32.png) [@iMat](https://forum.kirupa.com/u/iMat)\
**Post date:** [July 3, 2005, 6:05am UTC](https://forum.kirupa.com/t/squirrel-finder-pages/153630/1 "2005-07-03T06:05:14Z")

</div>

Help! I have this XML AS code (which is modified from Kirupa’s Squirrel Finder). I need a way to make it so that it only displays an “X” amount of items (xml entries) at once, with these two buttons that display the next “X” or previous “X” items.

EG. I have 5 items on display at once at any given time. When I press next, the next 5 items show and the previous are deleted, until I press previous again.

The code is as follows:

stop();  
var item\_spacing = 49; // how far menu items are spaced veritcally  
function CreateMenu(menu\_xml){

var items = menu\_xml.firstChild.firstChild.childNodes;  
for (var i=0; i\<items.length; i++) {  
var label = items\*.firstChild;  
var location = items\*.childNodes[1];

```
		location_text = location.firstChild.nodeValue;
		
		var item_mc = menu_mc.attachMovie("menu_item","item"+item_count, item_count);
		item_mc._y = item_count * item_spacing;
		item_count++;

		item_mc.label.text = label.firstChild.nodeValue;
		item_mc.description.text = this.location_text;

```

item\_mc.link = items\*.attributes.link;  
item\_mc.main\_btn.onRelease = function() {  
getURL(this.\_parent.link, “\_blank”);  
};

```
}

```

}

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(“contacts.xml”);

Thanks
