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”);