Help with a scrolling menu

[COLOR=black][FONT=Arial][COLOR=black][FONT=Arial]I know this has been asked in here eleventy-billion times but I need some help with a scrolling menu. I used Kirupa’s images gallery tutorial and did a little modifying; now instead of thumbnails I have a list of numbered buttons that are dynamically generated to correspond with the number of images in a given XML file.[/FONT][/COLOR]

[FONT=Times New Roman][SIZE=3]I have everything working pretty beautifully except I can’t seem to get the buttons to scroll. I have tried every tutorial I have come across so far and I have failed miserably every time.[/SIZE][/FONT]

[FONT=Times New Roman][SIZE=3]I would like to have it as an infinite menu but just getting it to scroll with out running off the page would be awesome!![/SIZE][/FONT]

[FONT=Times New Roman][SIZE=3]I removed the scrolling code I had in here so I don’t mess anyone else up. [/SIZE][/FONT]

[FONT=Times New Roman][SIZE=3]The main three methods I tried was Kirupa’s infinite scrolling menu, stringy’s modified Kirupa gallery with thumbnails that was an infinite scroll, and this:[/SIZE][/FONT]

[/FONT][/COLOR]


docWidth = 550;
stopping = false;
dx = 0;
damping = 01;
speed = 5;
function moveSlider() {
 numbersB._x += dx;
 if ((!stopping) && numbersB.hitTest(_root._xmouse, _root._ymouse, false)) {
  dx = speed*(docWidth-_root._xmouse*2)/docWidth;
 } else {
  dx *= damping;
 }
 if (numbersB._x>=10) {
  //numbersB._x -= numbersB._width/2;
  numbersB._x = 10;
 } else if (numbersB._x<numbersB._width/-4) {
  numbersB._x += numbersB._width/4;
  //trace(numbersB._width);
 }
}
numbersB.onEnterFrame = moveSlider;
 

[FONT=Arial]

[COLOR=black][FONT=Times New Roman][SIZE=3]Any insight would be greatly appreciated.[/SIZE][/FONT][/COLOR]

[COLOR=black][FONT=Times New Roman][SIZE=3]Here is the code:[/SIZE][/FONT][/COLOR]
[/FONT]


 
function loadXML(loaded) {
 if (loaded) {
  item_spacing = 20;
  item_count = 0;
  xmlNode = this.firstChild;
  image = [];
  description = [];
  item_mc = [];
  total = xmlNode.childNodes.length;
  for (i=0; i<xmlNode.childNodes.length; i++) {
   image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
   description* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
   item_mc* = numbersB.attachMovie("numbers_mc", "item"+i, i);
   item_mc*.btnid = i;
   item_mc*._x = i*item_spacing;
   item_mc*.trText.autoSize = "center";
   item_mc*.trText = i+1;
   item_count++;
   ///
   //
   item_mc*.onRelease = function() {
    picture.loadMovie(image[this.btnid], 1);
    img_text.desc_txt.text = description[this.btnid];
   };
   //trace(sp);
  }
  firstImage();
 } else {
  content = "file not loaded!";
 }
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
 if (Key.getCode() == Key.LEFT) {
  prevImage();
 } else if (Key.getCode() == Key.RIGHT) {
  nextImage();
 }
};
Key.addListener(listen);
img_text.previous_btn.onRelease = function() {
 prevImage();
};
img_text.next_btn.onRelease = function() {
 nextImage();
};
//
/////////////////////////////////////
p = 0;
//
///
this.onEnterFrame = function() {
 filesize = picture.getBytesTotal();
 loaded = picture.getBytesLoaded();
 preloader._visible = true;
 if (loaded != filesize) {
  preloader.preload_bar._xscale = 100*loaded/filesize;
 } else {
  preloader._visible = false;
  if (picture._alpha<100) {
   picture._alpha += 10;
  }
 }
};
function thisImage() {
 if (p<(total-1)) {
  p++;
  if (loaded == filesize) {
   picture._alpha = 0;
   picture.loadMovie(image[p], 1);
   picture_num();
  }
 }
}
function nextImage() {
 if (p<(total-1)) {
  p++;
  if (loaded == filesize) {
   picture._alpha = 0;
   picture.loadMovie(image[p], 1);
   img_text.desc_txt.text = description[p];
   picture_num();
  }
 }
}
function prevImage() {
 if (p>0) {
  p--;
  picture._alpha = 0;
  picture.loadMovie(image[p], 1);
  img_text.desc_txt.text = description[p];
  picture_num();
 }
}
function firstImage() {
 if (loaded == filesize) {
  picture._alpha = 0;
  picture.loadMovie(image[0], 1);
  img_text.desc_txt.text = description[0];
  picture_num();
 }
}
function picture_num() {
 current_pos = p+1;
 pos_txt.text = current_pos+" / "+total;
}
//