Fun with infinate loops. Loop works, controls do not

Hey all,
So I’ve continued to tweak the code I’m using for my news ticker. While the infinate loop problem from ealier has been solved I can’t seem to get the forward and backward button to work fully. I have it set so that if the user hits pause or the forward/backward button it pauses the loop and clearse the Interval. The forward and backward work as long as it’s going to the next or previous frame. When it’s supposed to jump back to the first frame or forward to the last frame nothing happens. Here’s my code. Any help would be most appreciated!

//FUNCTIONS
delay = 6000;
p = 1;
function infopane() {
myInterval = setInterval(pause_infopane, delay); 
function pause_infopane() { 
clearInterval(myInterval); 
 p++;
 if (p == 5) {
  gotoAndStop(2);
 } else {
  nextFrame();
  nextPane();
 }
} 
}
function nextPane() {  
infopane(); 
}
//CONTROLS
//pause
infopause_mc.onRollOver = function() {
 infopause_mc.infopause2_mc._visible = true;
}
infopause_mc.onRollOut = function() {
 infopause_mc.infopause2_mc._visible = false;
}
infopause_mc.onRelease = function() {
 clearInterval(myInterval);
 infopause_mc._visible = false;
}
//play
infoplay_mc.onRollOver = function() {
 infoplay_mc.infoplay2_mc._visible = true;
}
infoplay_mc.onRollOut = function() {
 infoplay_mc.infoplay2_mc._visible = false;
}
infoplay_mc.onRelease = function() {
 nextFrame();
 ns.pause();
 clearInterval(myInterval); 
 infopane();
 infopause_mc._visible = true;
}
//next
infonext_mc.onRollOver = function() {
 infonext_mc.infonext2_mc._visible = true;
}
infonext_mc.onRollOut = function() {
 infonext_mc.infonext2_mc._visible = false;
}
infonext_mc.onRelease = function() { 
clearInterval(myInterval);
ns.pause();
  infopause_mc._visible = false;
  if (p == 4) {
  gotoAndStop(2);
 } else {
  nextFrame();
 }
}
//back
infoback_mc.onRollOver = function() {
 infoback_mc.infoback2_mc._visible = true;
}
infoback_mc.onRollOut = function() {
 infoback_mc.infoback2_mc._visible = false;
}
infoback_mc.onRelease = function() {
  clearInterval(myInterval);
  ns.pause();
  infopause_mc._visible = false;
  if (p ==1) {
   gotoAndStop(4);
  } else {
  prevFrame();
  }
}
infopane();